Azure Web App错误,未知此类主机

Dav*_*ang 5 asp.net azure azure-web-sites azure-sql-database

在本地运行Web App时,没有问题可以连接到数据库,

将Web App部署到Azure之后,DB(Also Azure)连接尝试会引发以下错误:

[Win32Exception (0x80004005): No such host is known]

[SqlException (0x80131904): 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: TCP Provider, error: 0 - No such host is known.)]
Run Code Online (Sandbox Code Playgroud)

DB FW设置:允许访问Azure服务:设置为ON

关于如何解决/解决此问题的任何想法?

Pet*_*ebr 6

这可能是由于将连接字符串粘贴到之后造成的Data Source=

connectionString="Data Source=Server=...."
Run Code Online (Sandbox Code Playgroud)

相反,它应该是

connectionString="Server=...."  
Run Code Online (Sandbox Code Playgroud)


Ego*_*pov 5

确保您没有覆盖门户配置中的连接字符串 在此输入图像描述


Ale*_*kiy 1

您能否确保: 1) 允许远程连接到 SQL Server。- 你做到了,所以没关系。

2)使用您要连接的服务器的全名(myserver.database.windows.net)而不是其他名称。

您是否尝试使用 SQL Server Management Studio 从本地计算机连接到它?如果是这样,并且服务器身份验证设置为 SQL Server 和 Windows 身份验证并且它有效,那么请按照 David 建议粘贴详细信息,我们将尝试进行故障排除(实际上,使用 SQL Azure 没有那么多需要进行故障排除),或者尝试寻求技术支持。