Login failure into ACR with helm 3.7 / 3.8

MT 136 Reputation points
2022-02-07T03:40:55.217+00:00

Hi,

I am getting error: Error: Get "https://myregistry.azurecr.io/v2/": unauthorized: authentication required, visit https://aka.ms/acr/authorization for more information. when login a service principal with helm:

echo $SP_PASSWD | helm registry login myregistry.azurecr.io --username $SP_ACR_ID --password-stdin

On the other hand docker succeeds:

echo $SP_PASSWORD | docker login myregistry.azurecr.io --username $SP_ACR_ID --password-stdin
Login Succeeded

Can you suggest best way to resolve this? This is blocking azure pipeline builds.

Thanks!
MT

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

1 answer

Sort by: Most helpful
  1. srbhatta-MSFT 8,546 Reputation points Microsoft Employee
    2022-02-10T19:17:25.747+00:00

    Hi @MT ,
    Thanks for reaching out to Microsoft QnA Platform. Apologies for he delay in response.
    From the above commands posted by you, I can see the password is stored in two different variables for both the commands, one is $SP_PASSWD, and the other one is $SP_PASSWORD. Could you please check and verify if you are providing the the variable name correctly.

    Also, I checked and the helm registry login works fine. Please see the below output.

    ~$ echo -n "$password" | helm registry login $registry -u $username --password-stdin  
    Login Succeeded  
    ~$ helm version  
    version.BuildInfo{Version:"v3.8.0", GitCommit:"d14138609b01886f544b2025f5000351c9eb092e", GitTreeState:"clean", GoVersion:"go1.17.5"  
    

    Please let me know if the issue is still persisting and if the my above response helps.

    ----------------------------

    Please don't forget to "Accept as Answer" and "Upvote" and if you think my response was helpful, so that it can help others in the community looking for help on similar issues.

    0 comments No comments