Adrian
Adrian

Reputation: 720

Allowing IP Address through SQL Server Firewall

I have a Website (App Service), 1 Sql Server with 2 databases on it. Each month I randomly get an error:

Cannot open server 'myServer' requested by the login. Client with IP address 'xx.xxx.87.3' 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.

My question is, how do I know what application/service this IP address is? It's not the IP address of my website and if I ping the CNAME of my database, it doesnt match this IP. But if I don't add it, my whole site doesn't work. I must add this manually once per month, when something changes. How do I find out what this IP address is connected to?

Upvotes: 0

Views: 2698

Answers (1)

Stanley Gong
Stanley Gong

Reputation: 12153

Basically, there are 2 ways to solve your issue:

  1. Specify Allow Azure services and resources to access this server as Yes on your SQL server firewall-config so that your SQL server will allow all Azure resources to access.

  2. Adding all of the outbound IPs of your Azure app service into your SQL server firewall whitelist. It has a higher security level than the first way. You can find all the outbound IPs on Azure Portal here:

enter image description here

Upvotes: 1

Related Questions