我有一個應用程序,分爲三個部分,全部託管在Azure上:
(1)客戶端應用程序(HTML5 ,CSS3,JS),
(2)Web API,
(3)SQL Server數據庫實例。Azure - WebAPI無法連接到Azure數據庫,錯誤:系統找不到指定的文件[SqlException]
我有所有這些工作在本地主機上,從而使客戶端IP在Azure上的數據庫的防火牆設置後,然而,部署應用程序時,我從Web API收到以下錯誤:
[Win32Exception]: The system cannot find the file specified [SqlException]: 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: 52 - Unable to locate a Local Database Runtime installation. Verify that SQL Server Express is properly installed and that the Local Database Runtime feature is enabled.)
我試圖檢查Azure上的防火牆設置,並且我有「允許訪問Azure服務」,我猜測這意味着WebAPI服務應該可以訪問數據庫。
我剛纔已經成功地通過SQL Server Management Studio中連接與在web.config中相同的憑據爲好。
有什麼我應該檢查?
您是否使用ASP.Net身份進行身份驗證和授權? – Win
@Win - 是的,我也應該在App_Data中有一個.mdf文件。 –