2017-09-02 46 views
1

所以這是我第一個推出Azure用戶的web應用程序,所以我對此有點新。 我終於設法讓AD身份驗證正常工作,但現在一旦用戶登錄後,他們就無法訪問「管理您的帳戶」選項卡,這些選項卡會在您生成通常在/ accounts/*目錄。Azure Web服務管理你的accout鏈接給出的錯誤:26 - 錯誤定位服務器/實例指定)

當那他們引導到/帳戶上的廣告名稱,用戶點擊/管理頁面,他們將得到這個錯誤:

A network-related or instance-specific error occurred while establishing a 
connection to SQL Server. The server was not found or was not accessible. 
Verify that the instance name is correct and that SQL Server is configured to 
allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) 

,當我在我的機器上本地運行的應用程序這一過程工作完全正常,但不是在使用AD帳戶信息時。

我的問題是爲什麼它這樣做?我可以在哪裏修復它?

+0

檢查您的數據庫連接字符串。 – juunas

+0

這是我第一次想到的,但我找不到在/ Accounts/*目錄中找到的連接字符串。 – Sudosu0

回答

0

我使用下面的文章中提供的步驟測試了Azure AD。

Developing ASP.NET Apps with Azure Active Directory

項目模板並沒有創建默認/會計/我管理頁面。我正在使用Visual Studio 2017.

That was my first thought, but i could not find a connection string found in the /Accounts/* directory.

還請檢查根目錄中的web.config。是否有像下面這樣的連接字符串配置部分。請注意,本地數據庫不適用於Azure Web App,您可以將帳戶信息存儲在Azure SQL Database中。

<add name="DefaultConnection" connectionString="xxx" providerName="System.Data.SqlClient" /> 
+0

web.config指向我的Azure SQL數據庫。 – Sudosu0

+0

我建議你遠程調試你的web應用程序,找出哪一行代碼會導致異常。 – Amor

相關問題