1.1 ACR: Build, Store, Version & Manage Images
Key Takeaways
- Azure Container Registry (ACR) is a managed private Docker registry that stores images for App Service, AKS, Container Apps, and other Azure runtimes
- Basic, Standard, and Premium SKUs differ in storage, throughput, and Premium-only features such as geo-replication and customer-managed keys
- Image tags are mutable aliases; digests (sha256:...) uniquely identify an immutable image manifest and should be used for production pins
- Prefer Azure RBAC and managed identities over the registry admin user for push, pull, and CI/CD authentication
- Retention policies, content trust, and repository permissions help you manage image lifecycle and reduce registry sprawl
Azure Container Registry (ACR) is the private registry most Azure AI and cloud developers use to build, store, version, and manage container images. On the AI-200 exam, ACR sits at the start of the containerized-solutions domain: you push images into ACR, then App Service, Azure Container Apps, or AKS pull those images to run. Treating ACR as a first-class artifact store—not a temporary Docker Hub mirror—keeps deployments repeatable and secure.
Why ACR Exists on Azure
Public registries work for demos, but production AI services need private images, Azure-native identity, and network controls. ACR gives you:
- A fully managed Docker-compatible registry (OCI images and Helm charts)
- Integration with Microsoft Entra ID, managed identities, and Azure RBAC
- Optional private endpoints and firewall rules so images never traverse the public internet
- Tight coupling to Azure build and deploy tools (ACR Tasks, App Service continuous deployment, AKS image pull secrets via managed identity)
When an App Service Linux web app is configured for a custom container, the default mental model is: build → push to ACR → App Service pulls the tagged (or digest-pinned) image.
Registry SKUs: Basic, Standard, Premium
ACR ships three service tiers. You choose a SKU when you create the registry; you can change tiers later, but Premium-only features require the Premium tier.
| SKU | Typical use | Notable capabilities |
|---|---|---|
| Basic | Dev/test, low throughput | Cost-optimized entry tier; limited storage and bandwidth |
| Standard | Most production apps | Higher storage and throughput; webhook support; suitable for many App Service and Container Apps workloads |
| Premium | Enterprise / multi-region | Geo-replication, zone redundancy options, private link, customer-managed keys, higher limits |
Geo-replication (Premium concept)
Geo-replication replicates a Premium registry to additional Azure regions. Pulls from a nearby replica reduce latency and outbound transfer for regional AKS or App Service deployments. From a developer perspective you still push to one registry login server; ACR handles regional replicas behind the scenes. Exam scenarios often contrast a single-region Standard registry (fine for one App Service region) with Premium geo-replication when the same image must be pulled efficiently in multiple regions.
Remember: geo-replication is about image distribution, not about running containers. Compute (App Service, AKS) still runs where you deploy it; ACR replicas simply make the pull faster and more resilient.
Build and Push Images into ACR
You can build images locally with Docker and push them, or build in Azure (covered in the next section on ACR Tasks). A local flow looks like:
- Authenticate:
az acr login --name <registryName>(or use a service principal / managed identity in CI). - Tag the image with the ACR login server:
<registryName>.azurecr.io/<repository>:<tag>. - Push:
docker push <registryName>.azurecr.io/<repository>:<tag>.
Repository and naming conventions
Inside a registry, images live in repositories (for example ai-api, embeddings-worker). Good practice for AI-200-style solutions:
- One repository per deployable service
- Tags that encode environment or build metadata (
dev,staging,1.4.2,git-abc1234) - Avoid overwriting
latestas your only production identifier
Versioning: Tags Versus Digests
This distinction appears frequently in Azure container questions.
Tags
A tag is a human-readable pointer to a manifest. Tags are mutable by default: pushing myapi:1.0 again can replace what 1.0 points to. That convenience is dangerous for production rollbacks and audits.
Digests
Every pushed image manifest has a content-addressable digest, typically written as sha256:<hex>. Referencing @sha256:... pins the exact bytes of the image configuration and layers. Even if someone retags v1, the digest still resolves to the original content.
| Reference style | Example | Behavior |
|---|---|---|
| Tag only | contoso.azurecr.io/api:1.2.0 | Convenient; may change if retagged |
| Digest | contoso.azurecr.io/api@sha256:abc… | Immutable pin |
| Tag + digest (some tools) | Tag for readability, digest for deploy | Best of both for CD pipelines |
For App Service and Kubernetes manifests, prefer digest pins (or immutable tags enforced by policy) once a release is validated.
Manage Images Day to Day
Listing and inspecting
Use Azure CLI or the portal to list repositories, tags, and manifests. Inspecting a manifest shows architecture (amd64/arm64), layers, and created time—useful when debugging “wrong image” incidents after a push.
Retention and cleanup
Registries accumulate failed builds and intermediate tags. Retention policies (available on supported SKUs) can automatically untag or delete old manifests based on age or count. Pair retention with CI naming so you never delete the tag your production App Service still references.
Locking and permissions
- Repository-scoped permissions and Azure RBAC roles (
AcrPull,AcrPush,AcrDelete,Owner) limit who can mutate images. - Avoid enabling the registry admin user long-term; it uses a shared username/password. Prefer managed identities for App Service pull access and workload identities / service principals for pipelines.
Network and security controls
Premium registries support private endpoints, so pull traffic stays on your virtual network. Combine with Entra authentication and disable anonymous pull. For regulated AI workloads, also consider content trust / signed images where your pipeline requires provenance.
Connecting ACR to Downstream Hosts
ACR does not run your app; hosting services pull from it:
- App Service: configure the container image URL (and optional continuous deployment webhook from ACR).
- Azure Container Apps / AKS: use managed identity or pull secrets with
AcrPull. - ACR Tasks: build and optionally run containers using ACR-managed compute (next section).
Exam-focused checklist
When a scenario asks how to store and version images for Azure hosting, map the answer to ACR capabilities:
- Choose SKU based on geo-replication / private link needs.
- Push to
<name>.azurecr.io/repo:tag. - Prefer digests for production.
- Authenticate with RBAC + managed identity.
- Clean up with retention policies so registries stay manageable.
Mastering ACR image management is the foundation for every later container hosting skill on AI-200: if the wrong image lands in the registry—or the right image is tagged ambiguously—App Service and AKS will happily run the mistake at scale.
A team needs a single Azure Container Registry that can serve image pulls with low latency from App Service instances in East US and West Europe. Which ACR capability best matches this requirement?
Why should a production App Service deployment prefer an image digest over a floating tag such as latest?
Which authentication approach is recommended for an Azure App Service app that must pull private images from ACR in production?