acr-cli
acr-cli copied to clipboard
ACR Purge
PURGE_CMD="acr purge --filter '.:^GOLD.'
--ago 15d --dry-run"
az acr task create --name PurgeGold1
--cmd "$PURGE_CMD"
--schedule "00 16 * * *"
--registry "acrdemo2022coreg"
--context /dev/null
When this schedule runs, it shows that the repository also will be deleted but the expectation is to delete gold tag on all the repositories in the ACR.
The filter regexp is wrong.
Maybe you want something like
.*:GOLD$
Any char multiple times and end with :GOLD
https://regex101.com/r/hvDWro/1
You have a ^
start of line as the 3rd character.
The regexp can only be used for the tag, not the repository name.
Edit: This seems to have changed in the recent versions. It is two, separate regexes though - one for the repository, one for the tag.