ACR image retention

Subin Sabu 0 Reputation points
2025-01-08T10:58:26.5766667+00:00

Hi, is there a way to impose a retention policy on ACR, specifically for a repo? I want images older than 7 days to be gone.
Thanks.

Azure Container Registry
Azure Container Registry
An Azure service that provides a registry of Docker and Open Container Initiative images.
473 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Srinud 3,480 Reputation points Microsoft Vendor
    2025-01-09T17:26:24.8433333+00:00

    Hi Subin Sabu,
    Thank you for reaching us and sharing further information.
    As per your requirement, we would like to inform you that the SKU is standard and does not have a retention policy. To delete images in the standard SKU, this must be done manually. For the premium SKU, you need to untag the images using the az acr command, as per your response, and then apply the retention policy to delete the untagged images. Below is the command for untagging the image.

    az acr repository untag --name <ACR_NAME> --image <IMAGE_NAME:TAG>

    Please find the below document for more information: https://learn.microsoft.com/en-us/cli/azure/acr/repository?view=azure-cli-latest#az-acr-repository-untag
    https://learn.microsoft.com/en-us/azure/container-registry/container-registry-delete#delete-by-tag
    If the information is helpful, please consider by clicking the "Upvote" on the post.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.