This post has been republished via RSS; it originally appeared at: New blog articles in Microsoft Community Hub.
Today, I worked on a service request that our customer got the following error message using Java code:
Exception in thread "main" com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host servername.database.windows.net, port 1433 has failed. Error: "Permission denied: connect. Verify the connect
ion properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall."
"Exception in thread "main" com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host nodename.tenantring.northeurope1-a.worker.database.windows.net (redirected from servername.database.windows.
net), port 11001 has failed. Error: "Permission denied: connect. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.". at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:234)
I would like to share with you what was my lessons learned here.
The first thing is to isolate the problem running the suggested Java code to see the results:
The error message: Permission denied: connect reports that when when trying to open the port any firewall/NSG is blocking this outbound port, either, 1433 or redirect port 11000-12000.
If the issue is regarding with port 1433 means that the initial connection with port 1433 is rejecting, if the error message any port from 11000-12000 means that the issue is rejecting any of this port.
As a workaround, if your customer only has the port 1433 as outbound open, please, change the connection policy to Proxy meanwhile their networking team is opening as outbound connection from 11000-12000.