2017-04-19 46 views
0

我在Azure上发布了我的Web应用程序,并面临SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified的问题。我不知道为什么发生这种情况,因为当我在另一台服务器上发布我的应用程序时,它工作正常。Azure SQL网络接口,错误:26

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

在这里,我包括堆栈跟踪:https://pastebin.com/aqT3yCdw

这是我的,我发送请求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; 
     }); 
    }; 

回答

1

I published my web application on Azure and I face problem with SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified. I dont know exactly why this happens since when I published my application on another server, it works fine.

首先,请确认是否有人在Application Settings刀片在连接字符串(这将替换现有的条目,其中键等于链接的数据库名称)在Azure门户。

其次,请remote debug your web app检查服务器的实际值&代码正在访问的实例并确保服务器和实例名称正确。

第三,请确保您启用Azure connections允许从Azure应用程序连接到您的SQL Azure的服务器。

+0

您好,我找出了一段时间后,我不得不把'<删除名称=“RoleManager” />'到我的'web.config'文件。关于调试,我使用VS2015,并且有一些已知的远程调试错误,现在无法使用。 – Martin

相关问题