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”.
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.
- In the details view, select Firewalls and virtual networks.
- 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.
After performing the above steps, we were able to connect to the Azure SQL Server from SQL Server Management Studio.
NOTE: After adding the IP address, it might take up to 5 minutes for the change to take effect.
Hope it helps !!