Azure Container Registry: Store, Tag and Manage Images
30-second answer
Azure Container Registry (ACR) is a private registry at myreg.azurecr.io (your registry name plus azurecr.io) that stores images in repositories. A tag (ragapi:1.4.0) is a movable label, while a digest (sha256:…) identifies the exact image and never changes. You push with docker push after az acr login, copy public images in with az acr import, list versions with az acr repository show-tags, and let hosts pull with a managed identity that has the AcrPull role.
Exam objective: 1.1.1 Build, store, version, and manage container images by using Azure Container Registry. (Skills measured as of October 7, 2026)
Simulations
Feel it before you read it. No account needed, nothing leaves this page.
Open <strong>Container registries</strong> and select <strong>+ Create</strong>.
👆 Click the glowing item in the portal to continue
Read the steps as text
- Open Container registries and select + Create.
- The registry name becomes your login server, acrcontosoai.azurecr.io. Premium adds geo-replication and private endpoints.
- Leave the admin user off. Apps pull with a managed identity and the AcrPull role.
- Done. Go to resource.
- Push from your machine or Cloud Shell. The tag says which build; the digest says exactly which bytes.
- One repository per image name. Open chat-api.
- Two tags, one digest. That’s why :latest bites in production: it moves under you.
🧪 Simulation for learning. Screens are simplified versions of the Azure portal; names, prices and IDs are examples. Nothing here touches real Azure.
🖱️ Drag to rotate · scroll or pinch to zoom
Build an image, push it to the registry
Your Python API and everything it needs are packed into a container image. You push it to Azure Container Registry (ACR) as ragapi:1.4.0. A tag names a version. A digest (sha256:…) names the exact bytes and never changes.
🤔 What happens if…
Read this tour as text
- Build an image, push it to the registry. Your Python API and everything it needs are packed into a container image. You push it to Azure Container Registry (ACR) as
ragapi:1.4.0. A tag names a version. A digest (sha256:…) names the exact bytes and never changes. - ACR Tasks build in the cloud. ACR Tasks build the image inside Azure, so you don’t need Docker on your laptop.
az acr buildis a quick task. A task can also run on every git commit or when the base image (saypython:3.12-slim) gets a security patch. - App Service runs one container. App Service pulls the image and runs it. App settings become environment variables inside the container. A setting can be a Key Vault reference, so the secret never sits in the image or in the portal in plain text.
- Container Apps environment. An Azure Container Apps environment is a secure boundary with its own virtual network and Log Analytics workspace. Several container apps share it. Ingress decides who can reach each app: external (internet) or internal (only the environment).
- Revisions and traffic splitting. Every change to the template (image, env vars, scale rules) creates a new revision, an immutable snapshot. In multiple revision mode you can send 80% of traffic to the old one and 20% to the new one, then roll forward or back.
- KEDA scales on events. Container Apps uses KEDA scale rules. A Service Bus rule adds replicas as the queue grows (for example one replica per 5 messages), up to max replicas. When the queue empties, it scales back to min replicas, which can be zero.
- AKS runs what the manifest says. On AKS you describe the app in YAML manifests: a Deployment (image, replicas, probes, resources) and a Service (a stable address).
kubectl apply -fsends them. Kubernetes keeps the real state equal to what you declared. - Troubleshoot: logs, events, connectivity. When it breaks, look in three places. Logs (
kubectl logs,az containerapp logs show) show what the app said. Events (kubectl describe,kubectl get events) show what the platform did. Connectivity checks (DNS, ports, ingress) show whether traffic can reach it.
Your chat API needs an image before it can run anywhere. Build it in Azure without Docker on your laptop, look at what landed in the registry, then set up a task that rebuilds on every commit and every base-image patch.
🎓 Education-only simulation. Your lab is saved in this browser, so you can leave and continue later.
😟 THE PROBLEM
Production pulled :latest and got last night’s broken build.
😊 THE SOLUTION
Store versioned images in a private registry and deploy by tag or digest.
- Mystery “latest” images✓ Semantic version tags
- Images on a public hub✓ A private registry with Entra ID
- Old images pile up✓ Purge and retention rules
Start with a question
Production broke at 2 a.m. Which version of the app was it actually running?
The deployment said ragapi:latest. But latest was pushed three times yesterday, by two different people. Nobody can say for sure which build the servers pulled, so nobody knows what to roll back to.
That’s the problem a registry with good tags and digests solves. Azure Container Registry keeps every image version, and if you tag them properly you always know exactly what’s running.
Explain it like I’m 10
The technical explanation
A registry has a login server (myreg.azurecr.io). Inside it are repositories (ragapi), and each image in a repository has one or more tags and exactly one digest.
# Create a registry (name: 5-50 letters and numbers, globally unique)
az acr create --resource-group rg-ai --name myreg --sku Standard
# Sign Docker in with your Microsoft Entra ID account
az acr login --name myreg
# Tag a local image with the full registry name and push it
docker tag ragapi:dev myreg.azurecr.io/ragapi:1.4.0
docker push myreg.azurecr.io/ragapi:1.4.0
Seeing what’s there
az acr repository list --name myreg --output table
az acr repository show-tags --name myreg --repository ragapi --orderby time_desc --output table
az acr manifest list-metadata --registry myreg --name ragapi # digests, tags, dates
To run an exact image regardless of tags, reference the digest: myreg.azurecr.io/ragapi@sha256:….
Bringing images in
az acr import copies an image server side, so you don’t need Docker on your machine and you stop depending on Docker Hub rate limits:
az acr import --name myreg \
--source docker.io/library/python:3.12-slim \
--image base/python:3.12-slim
It works from another ACR too (--source otherreg.azurecr.io/ragapi:1.4.0), including across subscriptions when you have access.
Tagging so you can trust it
| Tag style | Example | Use it for |
|---|---|---|
| Stable tag | ragapi:1, ragapi:latest | Base images that should pick up patches |
| Unique tag | ragapi:1.4.0, ragapi:build-482, ragapi:3f9c2e1 | Anything you deploy |
Lock a release so nobody overwrites or deletes it:
az acr repository update --name myreg --image ragapi:1.4.0 \
--write-enabled false --delete-enabled false
Old builds pile up, so clean them: az acr repository delete --name myreg --image ragapi:1.2.0, or run acr purge on a schedule to remove tags older than a set age and untagged manifests.
-
1 Sign in
az acr login gets an Entra ID token for Docker.
-
2 Push
docker push uploads only the layers ACR doesn't have yet.
-
3 Version
The tag 1.4.0 and its sha256 digest now point at the same manifest.
-
4 Pull
A host with AcrPull pulls by tag or digest.
Who can pull and push
| Method | When |
|---|---|
Your Entra ID account (az acr login) | Developers at the command line |
| Managed identity + AcrPull | App Service, Container Apps, AKS pulling at run time |
| Service principal or workload identity + AcrPush | CI/CD pipelines |
| Admin account | Off by default; single-user testing only |
SKUs: Basic, Standard and Premium share the same features for storing and pulling. Premium adds the most storage and throughput, geo-replication to other regions and private endpoints.
Architect level Why digests matter for rollbacks
When you push, ACR stores the layers and a manifest that lists them. The digest is the hash of that manifest. Kubernetes and Container Apps can resolve a tag to a digest when they start a replica, but if the tag moves between two replica starts, you end up with mixed versions. Deploying by a unique tag, or pinning the digest in the manifest, makes every replica run the same bytes and makes “roll back to the last good build” a one-line change.
Real-world business scenario
Northwind Health (fictional)
- The problem
- Several teams pushed ragapi:latest from their laptops. Production pods ran two different builds after a node restart, and an auditor asked which code processed patient queries on a given day.
- What they used
- A Premium Azure Container Registry with private endpoints. Builds push version tags such as 2.3.1 and lock them; AKS and Container Apps pull with managed identities that have AcrPull.
- Why that choice
- Locked unique tags and digests give a permanent record of what ran, and managed identities removed the shared admin password.
- The result
- Every deployment record now names a digest the auditors can check, and rollbacks are a tag change.
When to use it and when not to
✓ Use it when…
- You need private images for App Service, Container Apps or AKS.
- You want to stop depending on public registry rate limits by importing base images.
- You need geo-replicated images close to clusters in several regions (Premium).
✕ Think twice when…
- Using the admin account for apps in production.
- Relying on :latest for anything you deploy.
↔ Alternatives to consider
- ACR Tasks to build images inside the registry instead of pushing from laptops.
- Microsoft Artifact Registry (mcr.microsoft.com) for public Microsoft base images you only pull.
Test yourself with exercises
5 original practice questions in the AI-200 style. Pick your answers, then check them. You will see why each option is right or wrong. Score 75% or more and this topic is marked complete.
Interview preparation
Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.
Beginner What's the difference between a tag and a digest?
Model answer
A tag is a name I choose, like 1.4.0 or latest, and it can be pointed at a new image later. A digest is the sha256 of the manifest, so it always means the exact same bytes. If I need to be certain what runs in production, I deploy by digest or by a tag nobody reuses.
Interviewer follows up
So why not always use latest?
You
Because latest moves. Two nodes can pull at different times and run different code, and rolling back is guesswork.
Intermediate How do you stop a released image from being overwritten?
Model answer
I lock it with az acr repository update and --write-enabled false. Pushing the same tag again then fails, and I can also set --delete-enabled false so nobody deletes it by mistake.
Experienced developer How should App Service, Container Apps and AKS authenticate to ACR?
Model answer
With Microsoft Entra ID, not the admin account. I give the host a managed identity and assign AcrPull on the registry. For AKS that's az aks update --attach-acr, which assigns AcrPull to the kubelet identity.
Scenario Your builds depend on python:3.12-slim from Docker Hub and you keep hitting pull rate limits. What do you do?
Model answer
Import the base image into our own registry with az acr import and point the Dockerfile at myreg.azurecr.io/python:3.12-slim. Builds pull from ACR, and we control when that base image changes.
Quick revision
Key points
- Image names are login-server/repository:tag, for example myreg.azurecr.io/ragapi:1.4.0.
- Tags move; digests don't. Use unique tags (version, build ID, commit) for deployments.
- az acr login signs Docker in with your Entra ID identity; the admin account is off by default.
- az acr import copies images between registries without a local Docker engine.
- az acr repository show-tags lists versions; --write-enabled false locks an image.
- SKUs are Basic, Standard and Premium; Premium adds geo-replication and private endpoints.
Important terminology
- Login server
- The registry's address, such as myreg.azurecr.io, used in every image name.
- Repository
- A named collection of related images inside a registry, such as ragapi.
- Tag
- A human-readable label on an image version; it can be moved to a different image.
- Digest
- A sha256 hash of the image manifest that uniquely and permanently identifies one image.
- AcrPull
- The built-in Azure role that lets an identity pull images from a registry.
- az acr import
- Copies an image from another registry into ACR on the server side, without Docker on your machine.
Common mistakes
- Deploying :latest to production and losing track of which build is running.
- Enabling the admin account and sharing its password with every app.
Exam tips
- "Copy an image from Docker Hub or another registry without Docker installed" = az acr import.
- "List all versions of an image" = az acr repository show-tags.
- "Replicate the registry to several regions" = Premium SKU with geo-replication.
Five quick revision questions
-
1.What is the login server format for ACR?Show
registry-name.azurecr.io, for example myreg.azurecr.io.
-
2.Which value always identifies the exact same image?Show
The digest (sha256).
-
3.Which command signs Docker in to ACR?Show
az acr login --name myreg
-
4.Which SKU supports geo-replication?Show
Premium.
-
5.Which flag on az acr repository update locks an image against overwrite?Show
--write-enabled false
Official references
Finished this lesson? Tick it off. Your progress is saved in this browser.
Next up: Build and Run Images with ACR Tasks
Lesson done? Make it stick with a quick gameSort It, Match the Pairs, Lightning Round and Who Am I? Earn XP and badges.