Azure: Error while connecting to Azure SQL Server “Cannot open server ‘…’ requested by the login. Client with IP address ‘…’ is not allowed to access the server”

Recently, while accessing azure SQL server from SQL Server Management Studio, we got the below error:

 “Cannot open server ‘server_name’ requested by the login. Client with IP address ‘xxx.xxx.xxx.xxx’ is not allowed to access the server”.

bbaa

To fix this issue, in Azure portal, we added the IP address of machine from which we were trying to access the SQL Server. Below are the steps to fix:

  • Go to Azure portal –> All Resources –> Click on Azure SQL Server that we are trying to access.

ee

  • In the details view, select Firewalls and virtual networks.

ff

  • Click on Add Client IP and then click on Save. The IP address of the machine will be added to the list of IPs from which we can access the Azure SQL Server.

cc

After performing the above steps, we were able to connect to the Azure SQL Server from SQL Server Management Studio.

dd

NOTE: After adding the IP address, it might take up to 5 minutes for the change to take effect.

Hope it helps !!

Leave a comment

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