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.
- 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. Yes, you can delete the images by first view the repository details by listing out the repository using Azure CLI commands as shown here: https://v4.hkg1.meaqua.org/en-us/cli/azure/acr/repository?view=azure-cli-latest#az-acr-repository-list-examples
Example:
then use delete command as shown here: https://v4.hkg1.meaqua.org/en-us/cli/azure/acr/repository?view=azure-cli-latest#az-acr-repository-delete-examplesaz acr repository list -n myregistry
Exampleaz acr repository delete -n myregistry --image hello-world:latest - Will only show Inactive images in there or might have active images as well? Otherwise I can safely delete everyone all of them.
It'll show active only if you have enabled artifact streaming,
View of the image before artifact streaming:
View of the image after enabling artifact streaming: