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.
ERROR: Failed to build image. See build logs for details.
# or
ERROR: The revision failed to provision: image pull failed:
unauthorized: authentication requiredCommon 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
- Read the ACR build logs in the error to fix the Dockerfile/build failure.
- Link the registry so the Container App can pull (
--registry-serverplus identity or credentials). - Ensure the Container Apps environment exists, or let
upcreate it with--environment.
Deploy a known-good image explicitly
Pre-build/push to ACR, then deploy that exact image with the registry wired up.
az containerapp up \
--name app --resource-group my-rg \
--environment my-env \
--image myacr.azurecr.io/app:1.2.3 \
--registry-server myacr.azurecr.ioHow 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.