az sql server firewall-rule

Manage a server's firewall rules.

Commands

az sql server firewall-rule create

Create a firewall rule.

az sql server firewall-rule delete

Deletes a firewall rule.

az sql server firewall-rule list

List a server's firewall rules.

az sql server firewall-rule show

Shows the details for a firewall rule.

az sql server firewall-rule update

Update a firewall rule.

az sql server firewall-rule create

Create a firewall rule.

az sql server firewall-rule create --end-ip-address
                                   --name
                                   --resource-group
                                   --server
                                   --start-ip-address
                                   [--subscription]

Examples

Create a firewall rule

az sql server firewall-rule create -g mygroup -s myserver -n myrule --start-ip-address 1.2.3.4 --end-ip-address 5.6.7.8

Create a firewall rule that allows access from Azure services

az sql server firewall-rule create -g mygroup -s myserver -n myrule --start-ip-address 0.0.0.0 --end-ip-address 0.0.0.0

Required Parameters

--end-ip-address

The end IP address of the firewall rule. Must be IPv4 format. Use value '0.0.0.0' to represent all Azure-internal IP addresses.

--name -n

The name of the firewall rule.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--server -s

Name of the Azure SQL server. You can configure the default using az configure --defaults sql-server=<name>.

--start-ip-address

The start IP address of the firewall rule. Must be IPv4 format. Use value '0.0.0.0' to represent all Azure-internal IP addresses.

Optional Parameters

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az sql server firewall-rule delete

Deletes a firewall rule.

az sql server firewall-rule delete [--ids]
                                   [--name]
                                   [--resource-group]
                                   [--server]
                                   [--subscription]

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name -n

The name of the firewall rule.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--server -s

Name of the Azure SQL server. You can configure the default using az configure --defaults sql-server=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az sql server firewall-rule list

List a server's firewall rules.

az sql server firewall-rule list [--ids]
                                 [--resource-group]
                                 [--server]
                                 [--subscription]

Examples

List a server's firewall rules

az sql server firewall-rule list -g mygroup -s myserver

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--server -s

Name of the Azure SQL server. You can configure the default using az configure --defaults sql-server=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az sql server firewall-rule show

Shows the details for a firewall rule.

az sql server firewall-rule show [--ids]
                                 [--name]
                                 [--resource-group]
                                 [--server]
                                 [--subscription]

Examples

Show a firewall rule

az sql server firewall-rule show -g mygroup -s myserver -n myrule

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name -n

The name of the firewall rule.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--server -s

Name of the Azure SQL server. You can configure the default using az configure --defaults sql-server=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az sql server firewall-rule update

Update a firewall rule.

az sql server firewall-rule update [--end-ip-address]
                                   [--ids]
                                   [--name]
                                   [--resource-group]
                                   [--server]
                                   [--start-ip-address]
                                   [--subscription]

Examples

Update a firewall rule

az sql server firewall-rule update -g mygroup -s myserver -n myrule --start-ip-address 5.4.3.2 --end-ip-address 9.8.7.6

Optional Parameters

--end-ip-address

The end IP address of the firewall rule. Must be IPv4 format. Use value '0.0.0.0' to represent all Azure-internal IP addresses.

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name -n

The name of the firewall rule.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--server -s

Name of the Azure SQL server. You can configure the default using az configure --defaults sql-server=<name>.

--start-ip-address

The start IP address of the firewall rule. Must be IPv4 format. Use value '0.0.0.0' to represent all Azure-internal IP addresses.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.