Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Client with IP address is not allowed to access the server Azure SQL database

I am facing the below error when I try to connect to the Azure SQL database of my free trial account. Can anyone help me how to set rules in my free trial account? I don't see any option to set them.

Cannot open server 'ccaausprddb001' requested by the login. Client with IP address '125.16.236.150' is not allowed to access the server.  To enable  access, use the Windows Azure Management Portal or run sp_set_firewall_rule on  the master database to create a firewall rule for this IP address or address  range.  It may take up to five minutes for this change to take effect.  ClientConnectionId:f1ce6d56-c321-4458-a8dc-507f40e24108 com.microsoft.sqlserver.jdbc.SQLServerException: Cannot open server 'ccaausprddb001' requested by the login. Client with IP address '125.16.236.150' is not allowed to access the server.  To enable access, use the Windows Azure Management Portal or run sp_set_firewall_rule on the master database to create a firewall rule for this IP address or address range.  It may take up to five minutes for this change to take effect. 
like image 823
Emmanuel Paul Avatar asked Jan 13 '16 06:01

Emmanuel Paul


People also ask

Does Azure SQL Database have IP address?

The following steps describe how a connection is established to Azure SQL Database: Clients connect to the gateway, that has a public IP address and listens on port 1433.

Is not allowed to access the server to enable access use the Windows Azure Management?

You need to set up server-level firewall rules for your server in the Azure portal. Go to the database that you have created by clicking SQL databases in left hand menu and select set server firewall as following figure. Under the firewall settings click add client IP and save it.


1 Answers

This can be solved by configuring the Firewall of the Azure SQL Server where the SQL database resides. I am using the new Microsoft Azure Portal. Please see the screenshot below, Selecting the SQL server from the listed resources Remember, you need to configure the Firewall and manage the IP addresses in SQL Server, not the SQL database.

Once you have selected the SQL Server,

  • Click the Settings -> Firewall
  • You will be requested Add a new Rule.
  • Add a name and enter the IP address(or the range) that will access the database. note: Azure automatically detects your current IP.

Follow these steps

Wait for 5 minutes and you are ready to go. I hope this helps.

like image 128
Swinkaran Avatar answered Sep 28 '22 06:09

Swinkaran