For connecting to SQL Azure, your IP Address should be added to SQL Azure Firewall, you can do this normally by SQL Azure Management Portal, but adding them one by one using Web Interface might be little difficult for SQL Azure Administrators
SQL Azure provides the following System Procedures to Manage SQL Azure Firewall policies
–To query the list of Active Firewall rules
SELECT * FROM sys.firewall_rules
To add a new IP Address or Range of IP Address to SQL Azure Firewall
–Query to Add or Update One or Range of IP Addresses to Firewall Policy
EXEC sys.sp_set_firewall_rule @name = N’Office’,
@start_ip_address = ‘XXX.XXX.XXX.1’,
@end_ip_address = ‘XXX.XXX.XXX.255’
–Query to Remove or Delete an IPAddress or IP Address Range from SQL Azure Firewall
EXEC sys.sp_delete_firewall_rule @name = N’Office’
If you look at the above screen shot, The policy with id 7 has been removed.
Using these System SPs, you can script your firewall policies and deploy them quickly on your new SQL Azure server, without having to use SQL Azure Management portal
One thought on “How to Configure SQL Azure Firewall using Queries”