Share via


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
                    [--cred-set]
                    [--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

--cred-set -c

The name of the credential set.

--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 acr cache delete

Delete a cache rule.

az acr cache delete --name
                    --registry
                    [--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

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

Default value: False
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 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

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

--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 acr cache update

Update the credential set on a cache rule.

az acr cache update --name
                    --registry
                    [--add]
                    [--cred-set]
                    [--force-string]
                    [--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

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

Default value: []
--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.

Default value: False
--remove

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

Default value: []
--remove-cred-set

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

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

Default value: []
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.