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!
Updated Oct 05, 2022
Version 2.0Jose_Manuel_Jurado
Microsoft
Joined November 29, 2018
Azure Database Support Blog
Follow this blog board to get notified when there's new activity