UPDATED:
Turn out there is an issue in the base64 encoded cmd. The cmd is trying to run az cli command and cause the error "unable to find image 'az:latest' locally
Hi,
I am trying to create an auto-cleaning task for our service's container registry describe in this document https://learn.microsoft.com/en-us/azure/container-registry/container-registry-auto-purge
The error message is:
2024/07/11 05:01:10 Launching container with name: acb_step_0
Unable to find image 'az:latest' locally
docker: Error response from daemon: pull access denied for az, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
See 'docker run --help'.
I tried the solution in https://learn.microsoft.com/en-us/azure/container-registry/allow-access-trusted-services?source=docs for both system assigned identity and user access managed identity, but still no luck...
I also found a GitHub issue https://github.com/Azure/acr/issues/400 that having the similar issue. They fixed the issue by upgrade Az cli but it was 2020 and I have the latest Az cli 2.62.0.
The task created by AZ cli can run successfully but will throw the error if created by bicep. I compared the json return by az acr task show
and they looks the same. Any hints on what's causing the error? Thanks