[RESOLVED ]Troubleshoot Network-restricted ACR task

Shujing Zhang 20 Reputation points Microsoft Employee
2024-07-11T05:14:58.8033333+00:00

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://video2.skills-academy.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://video2.skills-academy.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

Azure Container Registry
Azure Container Registry
An Azure service that provides a registry of Docker and Open Container Initiative images.
446 questions
{count} votes

Accepted answer
  1. vipullag-MSFT 26,296 Reputation points
    2024-07-12T05:45:58.41+00:00

    Hello Shujing Zhang

    Welcome to Microsoft Q&A Platform, thanks for posting your query here.

    Glad to know that the issue is resolved, I am summarizing the issue for the benefit of community.

    The command you are using az cli command that that makes task looking for az:latest locally. The cmd is trying to run az cli command and cause the error "unable to find image 'az:latest' locally. "acr purge" is a separate command.

    Accepting an answer helps other community members to know the answer helped you.
    https://video2.skills-academy.com/en-us/answers/support/accept-answer

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.