I want to retain the 10 latest (order by date) images and delete the rest, how do i achieve that using command line? I dig through the documentation from azure but didn't find anything related to limit option.
i want to achieve something like the --limit 10 thingy
az acr task create \
--name "purge-old-images" \
--resource-group "<RESOURCE_GROUP_NAME>" \
--registry "<ACR_NAME>" \
--cmd "az acr purge --name <ACR_NAME> --repository <REPOSITORY_NAME> --untagged --limit 10" \
--schedule "0 0 * * *"
It would be something like this (remove --dry-run after it is tested)