Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Azure SQL网络接口,错误:26_C#_Angularjs_Asp.net Mvc_Azure_Authorization - Fatal编程技术网

C# Azure SQL网络接口,错误:26

C# Azure SQL网络接口,错误:26,c#,angularjs,asp.net-mvc,azure,authorization,C#,Angularjs,Asp.net Mvc,Azure,Authorization,我在Azure上发布了我的web应用程序,我面临SQL网络接口问题,错误:26-定位指定的服务器/实例时出错。我不知道为什么会发生这种情况,因为当我在另一台服务器上发布我的应用程序时,它工作正常 我的连接字符串绝对正确,因为我从应用程序接收访问令牌时没有任何问题 这里我包括堆栈跟踪: 这是我的angular方法,我向API发送令牌请求,如果我得到它,我将令牌传递到请求头并重定向到仪表板,我猜根据堆栈跟踪,它可能会以某种方式丢失凭据,应用程序将不会登录用户,重新定位到我的安全仪表板将失败。问题是,

我在Azure上发布了我的web应用程序,我面临
SQL网络接口问题,错误:26-定位指定的服务器/实例时出错
。我不知道为什么会发生这种情况,因为当我在另一台服务器上发布我的应用程序时,它工作正常

我的连接字符串绝对正确,因为我从应用程序接收访问令牌时没有任何问题

这里我包括堆栈跟踪:

这是我的angular方法,我向API发送令牌请求,如果我得到它,我将令牌传递到请求头并重定向到仪表板,我猜根据堆栈跟踪,它可能会以某种方式丢失凭据,应用程序将不会登录用户,重新定位到我的安全仪表板将失败。问题是,我不明白,为什么这在某处有效,而在某处无效。有人能给我解释一下这个问题的原因吗

 $scope.signIn = function () {
        var params = "grant_type=password&username=" + $scope.username + "&password=" + $scope.password;
        $http({
            url: '/Token',
            method: "POST",
            headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
            data: params
        })
        .success(function (data, status, headers, config) {
            currentUser.setProfile(data.userName, data.Image, data.access_token);
            $http.defaults.headers.common.Authorization = "Bearer " + data.access_token;
            window.location = "/Dashboard#/";
        })
        .error(function (data, status, headers, config) {
           // Notification.error(data.error);
            $scope.showMessage = true;
        });
    };
我在Azure上发布了我的web应用程序,我面临SQL网络接口问题,错误:26-定位指定的服务器/实例时出错。我不知道为什么会发生这种情况,因为当我在另一台服务器上发布我的应用程序时,它工作正常

首先,请确保是否有人在Azure门户中的blade下指定了连接字符串(这将覆盖密钥等于链接数据库名称的现有条目)

其次,请检查代码正在访问的服务器和实例的实际值,并确保服务器和实例名称正确


第三,请确保您启用了允许Azure应用程序连接到Azure SQL server的功能。

您好,过了一段时间,我发现我必须将
放入我的
web.config
文件中。关于调试,我使用VS2015,远程调试中存在一些已知的错误,现在无法使用。