Home > SQL Azure, SQL Azure Admin > How to Configure SQL Azure Firewall using Queries

How to Configure SQL Azure Firewall using Queries


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

image

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’

image

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

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: