az acr config retention

Manage retention policy for Azure Container Registries.

Commands

az acr config retention show

Show the configured retention policy for an Azure Container Registry.

az acr config retention update

Update retention policy for an Azure Container Registry.

az acr config retention show

Show the configured retention policy for an Azure Container Registry.

az acr config retention show --registry
                             [--query-examples]
                             [--resource-group]
                             [--subscription]

Examples

Show the configured retention policy for an Azure Container Registry

az acr config retention show -r MyRegistry

Required Parameters

--registry -r

The name of the container registry. You can configure the default registry name using az configure --defaults acr=<registry name>.

Optional Parameters

--query-examples

Recommend JMESPath string for you. You can copy one of the query and paste it after --query parameter within double quotation marks to see the results. You can add one or more positional keywords so that we can give suggestions based on these key words.

--resource-group -g

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

--subscription

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

az acr config retention update

Update retention policy for an Azure Container Registry.

az acr config retention update --registry
                               --type {UntaggedManifests}
                               [--days]
                               [--resource-group]
                               [--status {disabled, enabled}]
                               [--subscription]

Examples

Enable retention policy for an Azure Container Registry to delete an untagged manifest after 30 days.

az acr config retention update -r MyRegistry --status Enabled --days 30 --type UntaggedManifests

Enable retention policy for an Azure Container Registry to delete a manifest as soon as it gets untagged.

az acr config retention update -r MyRegistry --status Enabled --days 0 --type UntaggedManifests

Required Parameters

--registry -r

The name of the container registry. You can configure the default registry name using az configure --defaults acr=<registry name>.

--type

The type of retention policy.

accepted values: UntaggedManifests

Optional Parameters

--days

The number of days to retain an untagged manifest after which it gets purged (Range: 0 to 365). Value "0" will delete untagged manifests immediately.

default value: 7
--resource-group -g

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

--status

Indicates whether retention policy is enabled.

accepted values: disabled, enabled
--subscription

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