Azure SQL Server Firewall IP address range

I would advise running a script using powershell / Azure command line tools for mac (http://azure.microsoft.com/en-us/documentation/articles/command-line-tools/) each time you wish to connect from a new IP.

If using a Mac link your Azure subscription using the command line tools then:

#!/bin/bash

externalIP=$(curl -s icanhazip.com)

ruleName="temp$externalIP"

echo "$externalIP"

azure sql firewallrule create [ServerName] "$ruleName" "$externalIP" "$externalIP"

Save it as azureip.sh and run from terminal.

If using windows there are many examples of using this from PowerShell


Will a range of 0.0.0.0 to 255.255.255.255 be OK to enter? Is there a range of IP addresses that will give me an 'Allow All'. Its not practical for me know where requests will be coming from and be constantly updating the Database firewall rules.

Yes, this will give access to your SQL Azure databases from every IP address though it is certainly not recommended. When you mentioned that you don't know from where you'll receive requests, do you mean requests to your application or the request to connect to the database? If it is requests to your application, you don't really need to specify this range. You can just specify 0.0.0.0 which will allow your application running in Windows Azure to access this database.

Tags:

Azure