One of the latest features introduced on SQL Azure is the abillity to apply firewall settings on your database and allow only specific IP ranges to connect to it. This can be done through SQL Azure Portal or through code using stored procedures.

If you want to take a look at which rules are active on your SQL Azure database, you can use:

select * from sys.firewall_rules

That will give you a view of your firewall rules.

If you want to add a new firewall rule, you can use the "sp_set_firewall_rule". The syntax is "sp_set_firewall_rule <firewall_rule_name> <ip range start> <ip range end>". For example:

exec sp_set_firewall_rule N'My setting','192.168.0.15','192.168.0.30'


If you want to delete that rule, you can use:

exec sp_delete_firewall_rule N'My setting'


PK.