0

I have a containerApp built with a default public image through a bicep script. I assign a system managed identity to the containerApp. I have assigned AcrPull role to the identity on the ACR private registryenter image description here

The ACR private registry has admin credentials disabled, so I use managed identity in containerApp.

I try to update the containerApp with the image from ACR through azure shell using this command

az containerapp up -n mycontainerapp -g my-rg -i myregistry.azurecr.io/mybranch-dev:latest --ingress external --target-port 5173

enter image description here getting this error:

Failed to retrieve credentials for container registry.  Please provide the registry username and password.

Can anyone help here ? Thanks

Coder
  • 39
  • 6

1 Answers1

0

I have followed the below steps to establish connectivity between the ACR and ACA using managed identity to pull iimages as below. Please check if you could able to ressolve the issue by following the below steps.

To reproduce the issue, I have provisioned container app and container registry. Go to Azure container apps and enable system assigned managed Identity as below and add AcrPull role.

enter image description here

enter image description here

enter link description here

After adding the AcrPull role to the ACA, I pushed the sample image to the container registry as below.

enter image description here

Edit:

Now before updating the image in the container app from ACR, you have to edit revision as the existed revision is created with public repository. To edit a revision, go to containers in ACA and click edit and deploy. enter image description here

enter image description here Click on save and create a new revision. You can also use verify in revisions.

Now I used az containerapp update to update the image

az containerapp update -n <container-app-name> -g <rg-name> -i acrvjyps.azurecr.io/nginx:v5

enter image description here

Reference: https://learn.microsoft.com/en-us/azure/container-apps/managed-identity-image-pull?tabs=azure-cli&pivots=azure-portal

HowAreYou
  • 605
  • 2
  • 6