Lesson Learned #256: Connection was denied since Deny Public Network Access and DNS resolution.

This post has been republished via RSS; it originally appeared at: New blog articles in Microsoft Community Hub.

Once a private link is created our customers disabled the option "Public network access" but connecting to the database they faced the following error: 'Microsoft SQL: Reason: An instance-specific error occurred while establishing a connection to SQL Server. Connection was denied since Deny Public Network Access is set to Yes. To connect to this server, use the Private Endpoint from inside your virtual network . In this article I would like to explain why this situation happened. 

 

The most tipical scenario is when the DNS server that our customer is using is resolving the public IP instead of resolving the private IP. For this reason, running a ping servername.database.windows.net is the best way to identify the IP address and check if your DNS is resolving the public or private IP. In case that is still resolving the public IP you need to contact with your networking team to review this issue.

 

In some situations, depending on Azure Service you need to configure other options to use the private IP instead of public one. 

 

Enjoy!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.