Is there a way we can exclude deleting certain tags from a Azure container repository and delete rest all tags present.
I have been trying with below command but doesn't seem to work
az acr run --registry <myRegistry> --cmd 'acr purge --filter "myRepo.^((?!tag_to_exlude).)*$”’ /dev/null
There is no direct way to exclude certain tags from an Azure container registry and delete rest all tags present. The
acr purgecommand does not support excluding tags.However, there is a workaround you can use to achieve the same result:
Here as you can see, except
V3I am deleting rest all version of my tag using the above script:In my repro I had different tags except v3 I delete all like below:
After running the script rest all deleted only v3 is left like below:
In portal: