3

Helm version: 3.6.1

Following steps are successful with ACR, adding remote chart repo:

  1. helm repo add myrepo https://myrepo.azurecr.io/helm/v1/repo --username "..." --password "..."
  2. helm search repo myrepo --> lists the available chart repos

But as soon as I try to install a chart with same credentials: (same for helm pull)
helm install myhelmtest mytest/testchart --username "..." --password "..." --debug
It would result in:
[debug] failed to fetch https://myrepo.azurecr.io/helm/v1/repo/_blobs/testchart-0.1.0.tgz : 401 Unauthorized

I also tried a successful helm registry login with same credentials beforehand, but it had no effect on above commands.

Any suggestions/ideas?

sl3dg3
  • 5,026
  • 12
  • 50
  • 74

1 Answers1

1

You may pass registry credentials appropriate for your scenario, such as service principal credentials, or a repository-scoped token.

For example you may create an Azure Active Directory service principal with pull and push permissions (AcrPush role) to the registry. Then supply the service principal credentials to helm registry login. The following example supplies the password using an environment variable:

echo $spPassword | helm registry login mycontainerregistry.azurecr.io \
  --username <service-principal-id> \
  --password-stdin

You can also login to the registry with your individual Azure AD identity to push and pull Helm charts.

az acr login --name <acrName>

https://learn.microsoft.com/en-us/azure/container-registry/container-registry-authentication?tabs=azure-cli#individual-login-with-azure-ad

Use following Azure documentation to authenticate to Azure ACR Helm repository. https://learn.microsoft.com/en-us/azure/container-registry/container-registry-helm-repos#authenticate-with-the-registry

Andriy Bilous
  • 2,337
  • 1
  • 5
  • 16