'ACR purge - How can i set regular expression to skip specific image from purging

I am managing a Azure Container Registry which has 100+ repository. I have scheduled a ACR Purge task which is deleting all image tag if the count is more then 5. Now customers are saying that we need some kind of exclusion so that we can skip certain image from cleanup.

For Example: if image has name like

rt123abc.Release

xyzqr345.Release

4hdcb324.Release

That means if image tag contains ".Release" text, it should not delete.

My script is something like this.

PURGE_CMD="acr purge --filter 'Repo1:.' --filter 'Repo2:.' --ago 1d --untagged --keep 5"

az acr run
--cmd "$PURGE_CMD"
--registry Myregistry
/dev/null

Thanks Den



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source