Also see Azure Container Apps ImagePullBackOff Error
I had a PROD GitHub Actions workflow that had been deploying fine, then suddenly started failing on the azure/container-apps-deploy-action@v1 step with an UNAUTHORIZED error when pulling the image. Here’s how I added temporary debug steps to the pipeline to pin down the actual cause instead of guessing.
The failure
The az containerapp update call the action runs under the hood failed with:
1 | ERROR: Failed to provision revision for container app 'chatbot-worker-produk'. |
This is a pull error, not a push error - the build/push job earlier in the workflow succeeded, so the image was definitely in ACR. Something about how the Container App itself authenticates to pull was broken.
Add debug steps instead of guessing
Rather than trying random fixes against a live PROD app, I added two extra steps after the deploy step with if: always(), so they run whether or not the deploy step succeeded:
1 | - name: Debug - show current ACR registry config on the Container App |
The first step dumps whatever registries are currently configured on the Container App plus the image it’s actually running. The second checks whether the service principal used by azure/login has an AcrPull role assignment scoped to the ACR.
What the debug output revealed
az containerapp registry list came back empty - no registries configured on the app at all. And the image query returned mcr.microsoft.com/k8se/quickstart:latest, the default placeholder Azure ships with new Container Apps. That told me this app had never successfully received an image from ACR, despite previous “successful” workflow runs.
That’s the key detail: a Container App remembers its registry credentials on the resource itself, not just for the run that configured them. Once az containerapp registry set runs successfully, that config sticks around across every future deploy. This PROD app just never had it set in the first place.
The fix
azure/container-apps-deploy-action needs registryUsername/registryPassword (or acrUsername/acrPassword if using acrName) to configure that registry the first time:
1 | with: |
Running the workflow with these in place fixed the deploy immediately - the debug step’s registry list was no longer empty, and the image matched what had actually been pushed.
This also explained something that had been bugging me: a sibling UAT workflow deploys fine without registryUsername/registryPassword at all. That’s because UAT’s Container App already had its registry configured from an earlier deploy, so it doesn’t need to be told again. Once I confirmed the same was now true for PROD, I removed the debug steps and the credentials from the workflow, and a follow-up deploy still succeeded - the config had persisted on the Container App resource itself.
Takeaway
If azure/container-apps-deploy-action fails with an ACR UNAUTHORIZED pull error, don’t assume it’s the service principal’s role assignment. Check what’s actually configured on the Container App with az containerapp registry list first - if it’s empty, the app has simply never had registry credentials set, and providing registryUsername/registryPassword once will fix it for good.
Docs: Azure Container Apps Build and Deploy action • az containerapp registry