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
The name of the cache rule.
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>.
The full source repository path such as 'docker.io/library/ubuntu'.
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.
Acquiring an Azure Policy token automatically for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
The related change reference ID for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
The name of the credential set.
User-assigned managed identity resource ID for ACR to authenticate with the upstream registry. Format: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.
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
The name of the cache rule.
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.
Acquiring an Azure Policy token automatically for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
The related change reference ID for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
Name of resource group. You can configure the default group using az configure --defaults group=<name>.
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
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.
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
The name of the cache rule.
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.
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
The name of the cache rule.
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.
Acquiring an Azure Policy token automatically for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
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: | [] |
The related change reference ID for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
The name of the credential set.
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 |
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 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: | [] |
Optional boolean indicating whether to remove the credential set from the cache rule. False by default.
| Property | Value |
|---|---|
| Default value: | False |
Name of resource group. You can configure the default group using az configure --defaults group=<name>.
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?
