How to fix this error(Status: 401. Unauthorized. ) getting it container registry

Durgasairam Ampolu 0 Reputation points
2023-10-08T11:23:56.5333333+00:00

Hi all,

can anyone help me with this error

while i created a container registry and trying to open repository it giving me this error(Status: 401. Unauthorized.).even i tired adding role assignment as reader , it didn't resolved my issue

User's image

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

2 answers

Sort by: Most helpful
  1. Prrudram-MSFT 28,286 Reputation points Microsoft Employee Moderator
    2023-10-13T18:40:23.69+00:00

    Hi @Durgasairam Ampolu

    Thank you for reaching out to the Microsoft Q&A platform.

    The "Status: 401. Unauthorized" error message indicates that the user or service principal that you are using to access the container registry does not have the necessary permissions to access the repository.

    Here are some steps that you can take to troubleshoot the issue:

    1. Verify that you are using the correct login credentials to access the container registry. You can use the az acr login command to log in to the registry using the Azure CLI. Make sure that you are using the correct username and password or token.
    2. Check that the user or service principal that you are using to access the container registry has the necessary permissions to access the repository. You can check the role assignments for the registry using the Azure portal or the Azure CLI. Make sure that the user or service principal has the "AcrPull" role or equivalent permissions to pull images from the registry.
    3. If you are using a service principal to access the container registry, make sure that the service principal has the correct permissions to access the registry. You can create a new service principal with the "AcrPull" role using the Azure CLI.

    Check that the repository that you are trying to access exists in the container registry. You can use the az acr repository list command to list the repositories in the registry.

    If you are still facing issues, try accessing the repository using the Azure portal or the Docker CLI to see if the issue is specific to the tool that you are using.

    If none of these steps resolve the issue, you can try contacting Azure support for further assistance.

    Please click "Accept as answer" if this helps.

    1 person found this answer helpful.
    0 comments No comments

  2. TP 125.8K Reputation points Volunteer Moderator
    2023-10-08T11:45:08.5433333+00:00

    Hi Durgasairam,

    After assigning yourself Reader role, there can be a delay before it takes effect. Please refresh the portal page now and see if you can access Repositories blade now.

    Please click Accept Answer and upvote if above was useful.

    Thanks.

    -TP

    0 comments No comments

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.