az acr network-rule

Manage network rules for Azure Container Registries.

Commands

az acr network-rule add

Add a network rule.

az acr network-rule list

List network rules.

az acr network-rule remove

Remove a network rule.

az acr network-rule add

Add a network rule.

az acr network-rule add --name
                        [--ip-address]
                        [--resource-group]

Examples

Add a rule to allow access for a subnet in the same resource group as the registry.

az acr network-rule add -n MyRegistry --vnet-name myvnet --subnet mysubnet

Add a rule to allow access for a subnet in a different subscription or resource group.

az acr network-rule add -n MyRegistry --subnet /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.Network/virtualNetworks/myvnet/subnets/mysubnet

Add a rule to allow access for a specific IP address-range.

az acr network-rule add -n MyRegistry --ip-address 23.45.1.0/24

Required Parameters

--name -n

The name of the container registry. It should be specified in lower case. You can configure the default registry name using az configure --defaults acr=<registry name>.

Optional Parameters

--ip-address

IPv4 address or CIDR range.

--resource-group -g

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

az acr network-rule list

List network rules.

az acr network-rule list --name
                         [--resource-group]

Examples

List network rules for a registry.

az acr network-rule list -n MyRegistry

Required Parameters

--name -n

The name of the container registry. It should be specified in lower case. You can configure the default registry name using az configure --defaults acr=<registry name>.

Optional Parameters

--resource-group -g

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

az acr network-rule remove

Remove a network rule.

az acr network-rule remove --name
                           [--ip-address]
                           [--resource-group]

Examples

Remove a rule that allows access for a subnet in the same resource group as the registry.

az acr network-rule remove -n MyRegistry --vnet-name myvnet --subnet mysubnet

Remove a rule that allows access for a subnet in a different subscription or resource group.

az acr network-rule remove -n MyRegistry --subnet /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.Network/virtualNetworks/myvnet/subnets/mysubnet

Remove a rule that allows access for a specific IP address-range.

az acr network-rule remove -n MyRegistry --ip-address 23.45.1.0/24

Required Parameters

--name -n

The name of the container registry. It should be specified in lower case. You can configure the default registry name using az configure --defaults acr=<registry name>.

Optional Parameters

--ip-address

IPv4 address or CIDR range.

--resource-group -g

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