Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

az acr cache

Manage cache rules in Azure Container Registries.

Commands

Name Description Type Status
az acr cache create

Create a cache rule.

Core GA
az acr cache delete

Delete a cache rule.

Core GA
az acr cache list

List the cache rules in an Azure Container Registry.

Core GA
az acr cache show

Show a cache rule.

Core GA
az acr cache update

Update the credential set on a cache rule.

Core GA

az acr cache create

Create a cache rule.

az acr cache create --name
 --registry
 --source-repo
 --target-repo
 [--acquire-policy-token]
 [--change-reference]
 [--cred-set]
 [--identity]
 [--resource-group]

Examples

Create a cache rule without a credential set.

az acr cache create -r myregistry -n MyRule -s docker.io/library/ubuntu -t ubuntu

Create a cache rule with a credential set.

az acr cache create -r myregistry -n MyRule -s docker.io/library/ubuntu -t ubuntu -c MyCredSet

Required Parameters

--name -n

The name of the cache rule.

--registry -r

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>.

--source-repo -s

The full source repository path such as 'docker.io/library/ubuntu'.

--target-repo -t

The target repository namespace such as 'ubuntu'.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--acquire-policy-token

Acquiring an Azure Policy token automatically for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--change-reference

The related change reference ID for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--cred-set -c

The name of the credential set.

--identity

User-assigned managed identity resource ID for ACR to authenticate with the upstream registry. Format: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.

--resource-group -g

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

az acr cache delete

Delete a cache rule.

az acr cache delete --name
 --registry
 [--acquire-policy-token]
 [--change-reference]
 [--resource-group]
 [--yes]

Examples

Delete a cache rule.

az acr cache delete -r myregistry -n MyRule

Required Parameters

--name -n

The name of the cache rule.

--registry -r

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

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--acquire-policy-token

Acquiring an Azure Policy token automatically for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--change-reference

The related change reference ID for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--resource-group -g

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

--yes -y

Do not prompt for confirmation.

Property Value
Default value: False

az acr cache list

List the cache rules in an Azure Container Registry.

az acr cache list --registry
 [--resource-group]

Examples

List the cache rules in an Azure Container Registry.

az acr cache list -r myregistry

Required Parameters

--registry -r

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

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--resource-group -g

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

az acr cache show

Show a cache rule.

az acr cache show --name
 --registry
 [--resource-group]

Examples

Show a cache rule.

az acr cache show -r myregistry -n MyRule

Required Parameters

--name -n

The name of the cache rule.

--registry -r

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

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--resource-group -g

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

az acr cache update

Update the credential set on a cache rule.

az acr cache update --name
 --registry
 [--acquire-policy-token]
 [--add]
 [--change-reference]
 [--cred-set]
 [--force-string]
 [--identity]
 [--remove]
 [--remove-cred-set]
 [--resource-group]
 [--set]

Examples

Change or add a credential set to an existing cache rule.

az acr cache update -r myregistry -n MyRule -c NewCredSet

Remove a credential set from an existing cache rule.

az acr cache update -r myregistry -n MyRule --remove-cred-set

Required Parameters

--name -n

The name of the cache rule.

--registry -r

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

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--acquire-policy-token

Acquiring an Azure Policy token automatically for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--add

Add an object to a list of objects by specifying a path and key value pairs. Example: --add property.listProperty <key=value, string or JSON string>.

Property Value
Parameter group: Generic Update Arguments
Default value: []
--change-reference

The related change reference ID for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--cred-set -c

The name of the credential set.

--force-string

When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.

Property Value
Parameter group: Generic Update Arguments
Default value: False
--identity

User-assigned managed identity resource ID for ACR to authenticate with the upstream registry. Format: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.

--remove

Remove a property or an element from a list. Example: --remove property.list <indexToRemove> OR --remove propertyToRemove.

Property Value
Parameter group: Generic Update Arguments
Default value: []
--remove-cred-set

Optional boolean indicating whether to remove the credential set from the cache rule. False by default.

Property Value
Default value: False
--resource-group -g

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

--set

Update an object by specifying a property path and value to set. Example: --set property1.property2=<value>.

Property Value
Parameter group: Generic Update Arguments
Default value: []

Feedback

Was this page helpful?