I'm in the process of migration my solution from classic pipelines to YAML pipelines in Azure DevOps.
One of the steps in the pipeline is the creation of ACI container from the image I build and push in the previous steps.
When I run this step using YAML pipeline it fails with the message -
"The image 'registry.azurecr.io/performancerunner:1.0' in container group 'performance-testing-container-group' is not accessible. Please check the image and registry credential."
When I run the exact same ACI container creating command from the classic pipeline it works.
I'm using AzureCLI task which looks like this
- task: AzureCLI@1
displayName: 'Run performance tests'
inputs:
azureSubscription: $(AZURE_SUBSCRIPTION)
scriptType: 'bash'
scriptLocation: 'scriptPath'
scriptPath: 'LoadTesting/deployment/scripts/run_tests.sh'
The content of the run_tests.sh looks like this
az container create -g $PERFORMANCE_TESTING_RG_NAME --registry-login-server "$PERFORMANCE_TESTING_REGISTRY_NAME.azurecr.io" --registry-username $PERFORMANCE_TESTING_REGISTRY_NAME \
--registry-password $REGISTRY_PASSWORD --image $IMAGE_NAME \
-n $PERFORMANCE_TESTING_CONTAINER_NAME --cpu 1 --memory 8 --restart-policy Never \
--command-line "dotnet LoadTests.dll -n testApp -c 1000"
When I echo this command, copy it with variables substituted from the logs and run it locally it works fine.