Share via

Failed to provision revision for container app because unauthorized

Ryan Thomas 0 Reputation points
2026-03-09T17:31:12.5433333+00:00

Here is the exact error:
Failed to provision revision for container app '--------'. Error details: The following field(s) are either invalid or missing. Field 'template.containers.--------.image' is invalid with details: 'Invalid value: "+++++++++.azurecr.io/api:latest": GET https:: UNAUTHORIZED: authentication required, visit https://aka.ms/acr/authorization for more information.; [map[Action:pull Name:api Type:repository]]';.. (Code: ContainerAppOperationError)

But as you can see here, I have all of the required role permissions assigned already
User's image

Azure Container Apps
Azure Container Apps

An Azure service that provides a general-purpose, serverless container platform.

{count} votes

1 answer

Sort by: Most helpful
  1. Q&A Assist
    2026-03-09T17:31:33.74+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    The error means Azure Container Apps cannot authenticate to Azure Container Registry when pulling the image, even though the registry roles look correct. The usual causes are:

    1. The container app is not actually configured to use a managed identity for image pull.
    2. The managed identity that has AcrPull is not the same identity the container app is using.
    3. ACR is not configured to accept ARM/managed-identity tokens.

    Use these checks and fixes:

    1. Verify ACR is configured for managed identity auth
      Run:
         az acr config authentication-as-arm show -r <REGISTRY>
      
      If it is disabled, enable it:
         az acr config authentication-as-arm update -r <REGISTRY> --status enabled
      
      This is required for both system-assigned and user-assigned managed identities to pull images from ACR.
    2. Confirm which identity the container app uses for image pull
      In the Container App resource in the portal:
      • Go to Identity and check whether System assigned is On and/or which User-assigned identity is attached.
      • Then go to Application → Containers → Edit and deploy and verify:
        • Image source is Azure Container Registry.
        • Authentication type is Managed identity.
        • Managed identity is set to the same identity that has AcrPull on the registry.
    3. If using system-assigned managed identity
      Follow the documented flow:
      • In Edit a container, set:
        • Image source = Azure Container Registry
        • Authentication type = Managed identity
        • Managed identity = System assigned
      • Save and create the new revision. The portal then attempts to automatically add the AcrPull role to that system-assigned identity. If it fails, manually assign AcrPull on the registry to the system-assigned identity and redeploy.
    4. If using user-assigned managed identity
      Ensure:
      • The user-assigned identity is attached to the container app.
      • That same identity has AcrPull on the registry (scope can be the registry or the specific repo).
      • The container definition’s Authentication type is Managed identity and the selected identity is this user-assigned identity.
    5. Redeploy a new revision after fixing configuration
      Once ACR is configured for ARM tokens and the correct identity is selected in the container app, create a new revision (for example via Edit and deploy). The unauthorized error should stop once the identity and ACR configuration match.

    If the error persists, also confirm that the image name and tag (api:latest in the error) exist in the registry and that there are no network/firewall rules blocking the Container Apps environment from reaching the registry.


    References:

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.