How to resolve Microsoft SQL Server, Error 47073? | Cannot connect to DBServer.database.windows.net?

This article help to resolve,

How to resolve Microsoft SQL Server, Error: 47073? OR Cannot connect to DBServer.database.windows.net?

ADDITIONAL INFORMATION:

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 (https://docs.microsoft.com/azure/azure-sql/database/connectivity-settings#deny-public-network-access). To connect to this server, use the Private Endpoint from inside your virtual network (https://docs.microsoft.com/azure/sql-database/sql-database-private-endpoint-overview#how-to-set-up-private-link-for-azure-sql-database). (Microsoft SQL Server, Error: 47073)

Why Microsoft SQL Server, Error 47073 OR | Cannot connect to DBServer.database.windows.net? occurred?

When new azure SQL database get created, if we do not grant access to database over internet this error occurred while connecting SQL in SSMS. By default public access is disabled and it is better to keep it disabled. Grant database access to required networks.

Resolution Steps : How to resolve Microsoft SQL Server, Error 47073?

Go to https://portal.azure.com/ and search azure SQL server name in search box.

Click on Azure SQL Server.

Go to Security tab and then Networking.

By default you will see Public access is disabled. Click on selected Network tab.

There are 2 option to grant access to Azure SQL database.

  1. If you have virtual network created and Azure SQL database and VM from which this database is going to get accessed is part of that virtual network. Add security run for that virtual network.
  2. If you want to grant direct access to VM from where you want to access Azure SQL Database and VM is not part of virtual network.
  3. Create firewall rule with IP associated with VM. You can create rule with IP range as well so that VM within that IP range can access Azure SQL DB.
  4. If you want to access SQL from same machine where azure portal is opened then you can just click on Add your IPv4 address.
  5. Once Above rule created , click on SAVE and retry to connect SQL in SSMS.
  6. If you want to allow access to all azure resource ,Select Allow Azure Services and to recourses to access this server. This option configures the firewall to allow connections from IP addresses allocated to any Azure service or asset, including connections from the subscriptions of other customers.

Check out another blog for Always availability errors :

Leave a Comment