In this azure tutorial, we will discuss how to fix the error, Cannot Open Server Requested By The Login Azure SQL. Which I got while trying to login to the Azure SQL database.
Table of Contents
Cannot Open Server Requested By The Login Azure SQL
Recently, I was working with a requirement where I had to write a stored procedure in my Azure SQL Db When I was trying to log in to the Query Editor (Preview), I got the error Cannot Open Server Requested By The Login Azure SQL.
- How To Connect To Azure SQL Database
- How to Export Azure SQL Database
- How To Call A Stored Procedure From Azure Functions
Login to the Azure Portal (https://portal.azure.com/)
Search for the SQL databases in the Azure Portal and click on the search result

You will see all your list of Azure SQL databases here. Click on the one that one you want to use. Now click on the Query editor (preview) link from the left navigation on the SQL database page. Enter the Login Username and password and click on the Login button, you can able to see I got the below error.

The Exact error message was like below
Cannot open server ‘sql1246’ requested by the login. Client with IP address ‘106.##.106.###’ 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. Set server firewall (sql1246)
Now we will see How to fix the error Cannot Open Server Requested By The Login.
Cannot Open Server Requested By The Login Azure SQL [Solved]
To fix the error, you need to set the firewall for the SQL server(sql1246) in my case. To set the firewall, click on the Set server firewall link from the error itself else you can search for the SQL Server in the Azure Portal and click on the search result.
You will get the list of SQL servers and click on the specific one, for which one you need to set the Firewall( You can see the complete error message to find the name of the SQL Server).
On the SQL server page, click on the Firewalls and virtual networks link from the left navigation. The next step is to click on the + Add client IP button as highlighted below and add the Client IP address in the Rule name, Start IP and End IP text boxes (For the exact Client IP you need to refer to the complete error message). Finally, click on the Save button.

Once, you will click on the Save button, you can find the below pop up, click on the OK button.

Now navigate to the Azure SQL Database and click on the Now click on the Query editor (preview) link from the left navigation on the Azure SQL database page. Enter the Login Username and password and click on the Login button, You will able to login successfully as shown below

This is how you can able to fix the error Cannot Open Server Requested By The Login Azure SQL.
You may also like following the below article
- The Type Or Namespace DbContext Could Not Be Found
- Cannot Update Remote Desktop Connection Settings For Administrator Account
- CS1061 C# ‘HttpRequest’ does not contain a definition for ‘Content’ and no accessible extension method ‘Content’ accepting a first argument of type ‘HttpRequest’ could be found
- The term ‘Uninstall-AzModule’ is not recognized as the name of a cmdlet
Wrapping Up
Well, In this article, we discussed how to fix the error, Cannot Open Server Requested By The Login Azure SQL. Which I got while trying to login to the Azure SQL database.