通过专用端点将Azure WebApp服务连接到SQL托管实例

时间:2019-06-14 11:29:27

标签: azure azure-web-app-service azure-sql-managed-instance

是否可以通过MI的专用终结点将Azure Web App连接到SQL托管实例?

按照https://docs.microsoft.com/en-us/azure/sql-database/sql-database-managed-instance-connect-app此处的文档,似乎只要Web应用程序服务与托管实例位于同一VNET中,那么通过私有端点的连接就应该可以。

我已在应用程序服务上启用了VNET集成,以便将其与托管实例集成到同一VNET中。我还在MI的端口1433上将Web应用程序的所有出站IP地址(包括其他IP地址)列入了白名单。

使用MI的专用连接字符串,在加载前端以及通过诊断工具检查连接字符串时,webapp无法连接。

启用MI上的公共终结点并将端口3342上的所有出站IP列入白名单,该Web应用程序可以毫无问题地直接连接。再次切换回专用端点失败。

收到的错误消息是:

System.Data.SqlClient.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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

0 个答案:

没有答案