sp_delete_firewall_rule (Azure SQL Database)

Applies to: YesAzure SQL Database yesAzure Synapse Analytics

Removes server-level firewall settings from your SQL Database server. This stored procedure is only available in the master database to the server-level principal login.


sp_delete_firewall_rule [@name =] 'name' 
[ ; ] 


The argument of the stored procedure is:

[@name =] 'name'
The name of the server-level firewall setting that will be removed. name is nvarchar (128) with no default.


In SQL Database, login data required to authenticate a connection and server-level firewall rules are temporarily cached in each database. This cache is periodically refreshed. To force a refresh of the authentication cache and make sure that a database has the latest version of the logins table, execute DBCC FLUSHAUTHCACHE (Transact-SQL).


Only the server-level principal login created by the provisioning process can delete server level firewall rules. The user must be connected to the master database to execute sp_delete_firewall_rule.


The following example removes the server-level firewall setting named 'Example setting 1'. Execute the statement in the virtual master database.

EXEC sp_delete_firewall_rule N'Example setting 1';   

See Also

Azure SQL Database Firewall
How to: Configure Firewall Settings (Azure SQL Database)
sp_set_firewall_rule (Azure SQL Database)
sys.firewall_rules (Azure SQL Database)