0
votes

I am developing an API which will be hosted in Azure app services. This api should fetch data from a SQL Server which is outside the Azure subscription. It uses SQL Server authentication to connect. Everything is working fine from my local machine, but when published to Azure, it is not getting connected and throws this error

.Net SqlClient Data Provider
number: 5, state: 0, errorClass: 20, server:"",

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)

1
The message seems clear to me. Probably firewall related or wrong network configuration. - Peter Bons
Hi, Hari KRK, did the error solved now? - Leon Yue
Not yet. It seems like network issue. but still trying to figure out - Hari KRK

1 Answers

0
votes

Please ensure you SQL server has opened the remote connection.

Right click SQL server--Properties, select Connections:

enter image description here

Hope this helps.