az storage account network-rule

Manage network rules.

Commands

Name Description Type Status
az storage account network-rule add

Add a network rule.

Core GA
az storage account network-rule list

List network rules.

Core GA
az storage account network-rule remove

Remove a network rule.

Core GA

az storage account network-rule add

Add a network rule.

Rules can be created for an IPv4 address, address range (CIDR format), or a virtual network subnet.

az storage account network-rule add --account-name
                                    [--action]
                                    [--ip-address]
                                    [--resource-group]
                                    [--resource-id]
                                    [--subnet]
                                    [--tenant-id]
                                    [--vnet-name]

Examples

Create a rule to allow a specific address-range.

az storage account network-rule add -g myRg --account-name mystorageaccount --ip-address 23.45.1.0/24

Create a rule to allow access for a subnet.

az storage account network-rule add -g myRg --account-name mystorageaccount --vnet-name myvnet --subnet mysubnet

Create a rule to allow access for a subnet in another resource group.

az storage account network-rule add -g myRg --account-name mystorageaccount  --subnet $subnetId

Required Parameters

--account-name -n

The storage account name.

Optional Parameters

--action

The action of virtual network rule. Possible value is Allow.

Default value: Allow
--ip-address

IPv4 address or CIDR range. Can supply a list: --ip-address ip1 [ip2]...

--resource-group -g

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

--resource-id

The resource id to add in network rule.

--subnet

Name or ID of subnet. If name is supplied, --vnet-name must be supplied.

--tenant-id

The tenant id to add in network rule.

--vnet-name

Name of a virtual network.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az storage account network-rule list

List network rules.

az storage account network-rule list --account-name
                                     [--resource-group]

Examples

List network rules. (autogenerated)

az storage account network-rule list --account-name MyAccount --resource-group MyResourceGroup

Required Parameters

--account-name -n

The storage account name.

Optional Parameters

--resource-group -g

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

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az storage account network-rule remove

Remove a network rule.

az storage account network-rule remove --account-name
                                       [--ip-address]
                                       [--resource-group]
                                       [--resource-id]
                                       [--subnet]
                                       [--tenant-id]
                                       [--vnet-name]

Examples

Remove a network rule. (autogenerated)

az storage account network-rule remove --account-name MyAccount --resource-group MyResourceGroup --subnet MySubnetID

Remove a network rule. (autogenerated)

az storage account network-rule remove --account-name MyAccount --ip-address 23.45.1.0/24 --resource-group MyResourceGroup

Required Parameters

--account-name -n

The storage account name.

Optional Parameters

--ip-address

IPv4 address or CIDR range. Can supply a list: --ip-address ip1 [ip2]...

--resource-group -g

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

--resource-id

The resource id to add in network rule.

--subnet

Name or ID of subnet. If name is supplied, --vnet-name must be supplied.

--tenant-id

The tenant id to add in network rule.

--vnet-name

Name of a virtual network.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.