How to delete Inactive Repositories from Container Registry programatically?

Guilherme Matheus 140 Reputation points Microsoft Employee
2025-10-15T12:43:49.86+00:00

I don't have much experience with Container Registry, but we were flagged internally in this image <masked>because of Ubuntu Security Notification for libxml2 Vulnerability (USN-7743-1), with this :

If I open my Container Registry I can see that container is in Inactive state:

User's image

Question I have:

  • Does it mean I can safely delete?
  • Also, the main question, how can I programmatically delete these inactive images? I did not find any REST API command, or CLI or anything. This would prevent any future problem.
  • Will only show Inactive images in there or might have active images as well? Otherwise I can safely delete everyone all of them

I am asking this last question, because when I execute the CLI show command I cannot see the streaming (Inactive) state:

{
  "changeableAttributes": {
    "deleteEnabled": true,
    "listEnabled": true,
    "readEnabled": true,
    "writeEnabled": true
  },
  "createdTime": "2025-09-09T12:12:02.0139514Z",
  "imageName": "<masked>",
  "lastUpdateTime": "2025-09-09T12:12:02.9365277Z",
  "manifestCount": 1,
  "registry": "<masked>",
  "tagCount": 2
}
Azure Container Registry
Azure Container Registry
An Azure service that provides a registry of Docker and Open Container Initiative images.
{count} votes

Answer accepted by question author
  1. Ankit Yadav 6,760 Reputation points Microsoft External Staff Moderator
    2025-10-15T16:33:38.81+00:00

    Hello Guilherme Matheus,

    The inactive value you are seeing is related to the feature called Artifact Streaming. To know more about the feature, see here: https://v4.hkg1.meaqua.org/en-us/azure/container-registry/container-registry-artifact-streaming?pivots=development-environment-azure-cli

    Answering your questions accordingly,

    • Does it mean I can safely delete?
      The inactive value doesn't mean exactly that they are not used anywhere at all, in general scenario you should review if your any of the services/projects are using that image or if you are part of a team, check with your teammates if they require those images and if it's concluded it's not required, you are good to delete the images.

    However, as discussed offline, here the images are being pushed to ACR from an AML service and is not being used anywhere, you are good to delete the images.

    View of the image after enabling artifact streaming: User's image


0 additional answers

Sort by: Most helpful

Your answer

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