Lesson Learned #239: Attempt was made to access a socket in a way forbidden by its access permission

This post has been republished via RSS; it originally appeared at: Azure Database Support Blog articles.

Our customer, using, for example, SQL SERVER Management Studio got the following error message:

 

TITLE: Connect to Server
------------------------------

Cannot connect to servername.database.windows.net.

------------------------------
ADDITIONAL INFORMATION:

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 - An attempt was made to access a socket in a way forbidden by its access permissions.) (Microsoft SQL Server, Error: 10013)

For help, click: https://docs.microsoft.com/sql/relational-databases/errors-events/mssqlserver-10013-database-engine-error

------------------------------

An attempt was made to access a socket in a way forbidden by its access permissions

------------------------------

 

This error message ocurred when the application is trying to open the port 1433 as outbound to connect to the database server. If you have a firewall that is blocking the port 1433 as outbound you are going to face this error. 

 

Additionally, you might have the same issue if you have Redirect as connection policy in your Azure SQL Server. Remember that when you have configured redirect the application will try to open a port range between 11000-11999 as outbound and if your firewall is blocking this range you are going to have the same error message. 

 

We have some scenarios that our customers have only allowed the port 1433 as outbound, in this situation, you could change your Connection Policy to Proxy to use only this port. Please, see the best practices in this URL.

 

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.