Skip to content
Latchkey

Azure "az containerapp up" Fails - Build & Deploy in CI

az containerapp up builds your image (often in ACR), creates or reuses a Container Apps environment, and deploys a revision - and one of those steps failed: a build error, a registry pull problem, or a missing environment.

What this error means

az containerapp up fails during the ACR build or when creating the revision. A build error or pull-permission problem reproduces each run; a transient ACR build-queue issue may clear on retry. The command output names the failing phase.

az output
ERROR: Failed to build image. See build logs for details.
# or
ERROR: The revision failed to provision: image pull failed:
unauthorized: authentication required

Common causes

ACR build or Dockerfile error

The source build in ACR failed - a Dockerfile error, a missing build context, or a dependency install failure - so no image is produced.

Image pull or environment/registry missing

The Container Apps environment cannot pull the image (registry not linked / no managed-identity access), or the named environment/registry does not exist yet.

How to fix it

Build the image and grant pull access

  1. Read the ACR build logs in the error to fix the Dockerfile/build failure.
  2. Link the registry so the Container App can pull (--registry-server plus identity or credentials).
  3. Ensure the Container Apps environment exists, or let up create it with --environment.

Deploy a known-good image explicitly

Pre-build/push to ACR, then deploy that exact image with the registry wired up.

Terminal
az containerapp up \
  --name app --resource-group my-rg \
  --environment my-env \
  --image myacr.azurecr.io/app:1.2.3 \
  --registry-server myacr.azurecr.io

How to prevent it

  • Pre-create the Container Apps environment and link the registry once.
  • Use managed identity for ACR pulls instead of stored credentials.
  • Deploy immutable image tags/digests rather than :latest.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →