I am trying to update a containerApp from a dockerimage in ACR built in previous step through Azure DevOps pipeline running with VMSS agent. The variable acrContainerRegistry contains value myregistry.azurecr.io
- stage: Build
// defined jobs
- task: Docker@2
displayName: Build and push an image to container registry
inputs:
command: buildAndPush
repository: $(acrImageRepository)
dockerfile: $(dockerfilePath)
containerRegistry: $(dockerRegistryConn)
tags: |
$(tag)
- stage: DeployContainerApp
//defined jobs
- task: AzureContainerApps@1
inputs:
azureSubscription: $(armConn)
acrName: $(acrContainerRegistry)
containerAppName: $(CONTAINER_APP_NAME)
resourceGroup: $(RG_NAME)
imageToDeploy: $(acrContainerRegistry)/$(acrImageRepository)-$(Build.SourceBranchName):latest
containerAppEnvironment: $(CONTAINER_APP_ENV_NAME)
location: $(CONTAINER_APP_ENV_LOCATION_NAME)
ingress: "external"
targetPort: 80
The docker task is successful and image is pushed to acr, The AzureContainerApps@1 task fails with this error
/usr/bin/bash -c CA_ADO_TASK_ACR_ACCESS_TOKEN=$(az acr login --name myregistry.azurecr.io --output json --expose-token --only-show-errors | jq -r '.accessToken');
docker login myregistry.azurecr.io.azurecr.io -u 00000000-0000-0000-0000-000000000000 -p $CA_ADO_TASK_ACR_ACCESS_TOKEN > /dev/null 2>&1
##[error]Unable to run provided bash command 'CA_ADO_TASK_ACR_ACCESS_TOKEN=$(az acr login --name myregistry.azurecr.io --output json --expose-token --only-show-errors | jq -r '.accessToken'); docker login myregistry.azurecr.io.azurecr.io -u 000000-0000-0000-0000-000000000000 -p $CA_ADO_TASK_ACR_ACCESS_TOKEN > /dev/null 2>&1'.
##[error]Unable to authenticate against ACR instance 'myregistry.azurecr.io.azurecr.io' with access token.
##[error]The process '/usr/bin/bash' failed with exit code 1
Here i notice that docker is trying to login with a extra azurecr.io
myregistry.azurecr.io.azurecr.io. is this the reason for failure? I am not sure how this gets appended?
Can anyone help here?