Azure VPN to on-premises cannot connect SQL Server from azure web app

元气小坏坏 提交于 2019-12-08 05:18:53

问题


We have setup our VPN connection in Azure to our on-premises database, the connect is working with no problems. I have written a MVC app that tries to connect to our on-premise database in SQL Server and am getting the following error:

System.Data.SqlClient.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.

The connection string I am using is:

name="productdbConnectionString" connectionString="Data Source=172.16.x.xx,1433;Initial Catalog=productdb;User Id=poppy;Password=poppyxxxxx" providerName="System.Data.SqlClient"

I have opened TCP and named pipes and I am using port 1433 in the connection string so am a bit confused why I cannot access the database?


回答1:


We could connect the web app to local on-premises SQL Server database using the Hybrid Connection feature. Please refer to this documentation that explained how to connect to on-premises SQL Server from a web app in Azure App Service using Hybrid Connections.



来源:https://stackoverflow.com/questions/40979382/azure-vpn-to-on-premises-cannot-connect-sql-server-from-azure-web-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!