ContainerApp update command fails to pull image from private registry with admin credentials disabled

Bharath 10 Reputation points
2023-07-04T18:02:46.6266667+00:00

I have an nodejs application image stored in a private ACR with admin credentials disabled. I have created a containerApp with system assigned managed identity which has the azrPull role on the private ACR.

The containerApp has been created with a public image.

I try to update the containerApp with the following task in devops

steps:
    - task: AzureContainerApps@1
      inputs:
        azureSubscription: $(armServiceConnection)
        acrName: $(acrContainerRegistry)
        containerAppName: $(CONTAINER_APP_NAME)
        resourceGroup: $(RG_NAME)
        imageToDeploy: $(acrContainerRegistry).azurecr.io/$(acrImageRepository)-$(Build.SourceBranchName):latest
        containerAppEnvironment: $(CONTAINER_APP_ENV_NAME)
        location: $(CONTAINER_APP_ENV_LOCATION_NAME)
        ingress: "external"
        targetPort: 80		

before this task the

- task: Docker@2

successfully builds the application image and stores it in acr. When this task is run i check the logs:

/usr/bin/bash -c CA_ADO_TASK_ACR_ACCESS_TOKEN=$(az acr login --name myregistry --output json --expose-token --only-show-errors | jq -r '.accessToken'); 
docker login myregistry.azurecr.io -u 00000000-0000-0000-0000-000000000000 -p $CA_ADO_TASK_ACR_ACCESS_TOKEN > /dev/null 2>&1
/usr/bin/az containerapp up -n mycontainerapp -g myrg -i myregistry.azurecr.io/mybranch-dev:latest --ingress external --target-port 80
ERROR: Failed to retrieve credentials for container registry. Please provide the registry username and password

if i execute the same commands from my local system the below command

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

gives the same error:

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

role_assgined_azrpull

image_pull

same error in pipeline as well as local system. Can anyone help?Thanks

Azure Container Apps
Azure Container Apps
An Azure service that provides a general-purpose, serverless container platform.
329 questions
0 comments No comments
{count} vote