Azure Container Registry and Container Instances for Admins
30-second answer
Azure Container Registry (ACR) is your private image store. You pick a tier: Basic, Standard or Premium, and only Premium adds geo-replication and private endpoints. Apps pull with a Microsoft Entra identity that has the AcrPull role, and the admin user stays off. Azure Container Instances (ACI) runs an image as a container group in seconds, with the CPU and memory you set at creation and a restart policy of Always, OnFailure or Never. ACI bills per second and doesn't autoscale. To change CPU or memory, you recreate the group.
Simulate it » No Azure account neededExam objective: 3.3.1 Create and manage an Azure Container Registry. 3.3.2 Provision a container by using Azure Container Instances. 3.3.4 Manage sizing and scaling for containers, including Azure Container Instances and Azure Container Apps. (Skills measured as of April 17, 2026)
Simulations
Feel it before you read it. No account needed, nothing leaves this page.
Start on <strong>Home</strong>. Select the search bar.
👆 Click the glowing item in the portal to continue
Read the steps as text
- Start on Home. Select the search bar.
- Type container registries in the search bar and pick Container registries under Services.
- The name is 5 to 50 letters and numbers, no hyphens, and becomes the login server. Standard suits most teams. Choose Premium if you need geo-replication or private endpoints.
- A month later Europe wants a nearby copy. Services → Geo-replications says no: it’s Premium only. You can change the tier in place, with no downtime.
- In Settings → Properties switch the plan to Premium and Save. Images and tags stay as they are. Keep the admin user off; give pulling identities the AcrPull role.
- Type container instances in the search bar and pick Container instances under Services.
- Pick the image from your registry and set the size: CPU and memory are fixed for the life of the group. ACI won’t scale them for you.
- On Advanced, the restart policy decides what happens when the container exits. On failure fits a job: done is done, and billing stops. Always fits a long-running service.
- The job ran and finished. To change CPU or memory later you redeploy the group; for automatic scaling, use Container Apps.
🧪 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
A registry feeds Container Instances
Azure Container Registry stores your private images. Container Instances runs them as a container group with the CPU and memory you set and a restart policy: Always, OnFailure or Never. It doesn’t scale itself, and only Premium registries can geo-replicate.
🤔 What happens if…
Read this tour as text
- A registry feeds Container Instances. Azure Container Registry stores your private images. Container Instances runs them as a container group with the CPU and memory you set and a restart policy: Always, OnFailure or Never. It doesn’t scale itself, and only Premium registries can geo-replicate.
- Container Apps scale on HTTP traffic. Each replica gets an allowed CPU and memory pair (0.5 vCPU with 1 Gi here). An HTTP scale rule adds a replica per 50 concurrent requests, between min and max replicas. With min 0, a quiet app scales to zero.
- The plan is the VMs. An App Service plan is a set of VMs. Every app on the plan runs on every instance. Scale out adds instances (Basic: up to 3). Scale up moves to a bigger or richer tier, which also decides the features you get.
- Autoscale rules (Standard and up). On Standard or Premium, a rules-based autoscale setting watches a metric such as CPU Percentage and adds or removes instances between a minimum and maximum, with a cool-down so it doesn’t flap.
- Prove you own the domain. To map www.contoso-learn.com, App Service needs a TXT record asuid.www holding the app’s verification ID, plus a CNAME from www to the app (an A record for the root domain). Free tier can’t do custom domains.
- Certificate, HTTPS Only, TLS 1.2. A free App Service managed certificate (Basic and up, no wildcards, not exportable) is bound with SNI SSL. HTTPS Only redirects HTTP, and the minimum TLS version (1.2 by default) turns away old clients.
- Back up to your own storage. Automatic backups run hourly with no setup. Custom backups write files, configuration and linked databases (up to 10 GB) to a blob container you own, on demand or on a schedule with retention. Basic tier and up.
- Outbound and inbound are different switches. VNet integration is outbound: the app reaches private resources through a delegated subnet. Inbound is controlled by access restrictions (allow and deny rules by priority) or a private endpoint.
- Staging slot, warm-up, swap. A deployment slot (Standard: 5, Premium v3: 20) is a live copy of the app. Deploy to staging, then swap: App Service warms staging up first, so users never hit a cold start. Slot settings stay with their slot.
Contoso wants a private registry for its images, a nightly invoice job that runs once and stops, and an orders API that scales with traffic. Set up all three the way an administrator would, and pick the right size and scaling for each.
🎓 Education-only simulation. Your lab is saved in this browser, so you can leave and continue later.
😟 THE PROBLEM
A nightly job runs on a VM that sits idle 23 hours a day.
😊 THE SOLUTION
Keep the image in a private registry and run it in Container Instances only when needed.
- Paying for an idle VM✓ Per-second billing, restart policy OnFailure
- Images on a public hub✓ Private registry with AcrPull
- Slow pulls in Europe✓ Premium geo-replication
Start with a question
Why pay for a server all day for a job that runs for five minutes?
Think of a bakery that bakes a special cake once a night. It doesn’t buy a second oven and leave it on all day. It keeps the recipe in a locked cupboard, rents an oven for five minutes each night, and hands the oven back when the cake is done.
In Azure the locked cupboard is Azure Container Registry: your private images, safe and versioned. The rented oven is Azure Container Instances: it runs one image as a container group, with the CPU and memory you ask for, and stops when the job is done if you tell it to.
Explain it like I’m 10
The technical explanation
Azure Container Registry: create and manage it
A registry name is 5 to 50 letters and numbers, no hyphens, and it becomes the login server: acrcontoso.azurecr.io. Images live in repositories and are named by tag (invoice-job:v1) or by digest (sha256:…).
| Tier | Included storage | Good for | Premium-only extras |
|---|---|---|---|
| Basic | 10 GiB | Learning and small teams | |
| Standard | 100 GiB | Most production teams | |
| Premium | 500 GiB | Large, global or locked-down setups | Geo-replication, private endpoints, the highest throughput |
You can move between tiers in place. Upgrading to Premium doesn’t move or rebuild images, and there’s no downtime.
Portal: search Container registries, select + Create, fill in Registry name, Location and Pricing plan, then Review + create. Later, Settings → Properties changes the plan and Services → Geo-replications adds regions.
az acr create -g rg-admin-apps -n acrcontosoadm01 --sku Standard
az acr import -n acrcontosoadm01 --source mcr.microsoft.com/azuredocs/aci-helloworld:latest --image aci-helloworld:v1
az acr update -n acrcontosoadm01 --sku Premium
az acr replication create -r acrcontosoadm01 -l westeurope
New-AzContainerRegistry -ResourceGroupName rg-admin-apps -Name acrcontosoadm01 -Sku Standard -Location eastus
Update-AzContainerRegistry -ResourceGroupName rg-admin-apps -Name acrcontosoadm01 -Sku Premium
Who can pull? Give the app’s managed identity (or a service principal) the AcrPull role on the registry. AcrPush adds push. The admin user is one shared username and password for the whole registry; it’s off by default, and you should keep it that way outside quick tests.
Azure Container Instances: provision a container
ACI deploys a container group: one or more containers scheduled on the same host, sharing a lifecycle, an IP address and any mounted volumes (such as an Azure Files share). Linux groups can hold several containers; Windows groups are more limited.
Portal: search Container instances, select + Create. On Basics: container name, region, Image source (Quickstart images, Azure Container Registry, Other registry), image and tag, OS type and Size (vCPU and memory). Networking sets Public or Private, a DNS name label and ports. Advanced holds the restart policy, environment variables and command override.
az container create -g rg-admin-apps -n aci-invoice-job \
--image mcr.microsoft.com/azuredocs/aci-helloworld \
--cpu 1 --memory 1.5 --restart-policy OnFailure --os-type Linux
For an image in your own registry, add --registry-login-server, --registry-username and --registry-password, or --acr-identity with a managed identity that has AcrPull.
Sizing and scaling ACI
| Setting | What to know |
|---|---|
| CPU and memory | Requested per container when you create the group. Most regions give a standard Linux group up to 4 vCPU and 16 GB. |
| Changing size | Not in place. CPU, memory, OS type and restart policy need a delete and recreate. |
| Scaling | None built in. More load means more groups that you create, or a move to Container Apps or AKS. |
| Billing | Per second of vCPU and memory while the group runs. |
| Restart policy | Behaviour | Use it for |
|---|---|---|
| Always (default) | Restarts the container whenever it stops | Long-running services |
| OnFailure | Restarts only on a non-zero exit code | Batch jobs that should retry on error |
| Never | Runs once and stays stopped | One-off tasks you want to inspect after |
Architect level Why not just use the admin user?
The admin user is one credential shared by everyone and everything, with push and pull rights. You can’t tell who used it, and rotating it breaks every app at once. With Microsoft Entra ID, each app’s managed identity gets exactly AcrPull on one registry, you see it in the activity log, and nothing has a password to leak. Some older tools still need the admin user; if you must use it, rotate the password and turn it off again when you’re done.
Real-world business scenario
Contoso Finance (fictional)
- The problem
- An invoice-matching job ran each night on a D4s VM that stayed on all day. Images sat in a public Docker Hub repository, and the European office complained that pulls were slow.
- What they used
- A Premium Azure Container Registry in East US with a West Europe replica, pulled by managed identities with AcrPull. The nightly job runs in Azure Container Instances with 2 vCPU, 4 GB and restart policy OnFailure, started by a Logic App at 02:00.
- Why that choice
- Per-second billing for a 20-minute job instead of a full-time VM, private images with no shared password, and local pulls in Europe.
- The result
- The job costs a few dollars a month instead of a full VM bill, and the VM was deleted. Failed runs retry on their own, and successful ones stop billing the moment they finish.
When to use it and when not to
✓ Use it when…
- You need private, versioned images for any Azure container host.
- A job runs on a schedule or on demand and should stop when it finishes.
- You want a single container running in seconds without a VM or cluster.
✕ Think twice when…
- The app must scale out and in with traffic. Use Container Apps.
- You need deployment slots, custom domains and backups for a web app. Use App Service.
- You only ever pull public images you never change, so a registry adds little.
↔ Alternatives to consider
- Azure Container Apps for container apps that scale on HTTP or events, down to zero.
- Azure Kubernetes Service when you need the full Kubernetes API.
- Azure App Service for web apps that run from a container image with slots and TLS.
Test yourself with exercises
5 original practice questions in the AZ-104 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 Azure Container Registry and Azure Container Instances?
Model answer
ACR stores images and ACI runs them. The registry is like a private shelf of packaged apps. Container Instances takes one of those packages and runs it as a container group, with the CPU and memory I choose, without me building any VM or cluster.
Intermediate Which ACR tier would you choose for a team in the US and Europe that wants fast pulls in both places?
Model answer
Premium, because geo-replication is Premium only. I'd add a replica in the European region so pulls there stay local, and pushes to either region sync to both. If the registry is Standard today, I can upgrade it in place with az acr update --sku Premium, and the images stay where they are.
Experienced developer A container group needs more memory. How do you change it?
Model answer
I can't resize it in place. CPU, memory, the OS type and the restart policy are fixed properties, so I delete the container group and create it again with the new values, usually from the same YAML or ARM template. If it keeps needing more capacity under load, it probably belongs in Container Apps, which scales on rules.
Scenario A nightly ACI job keeps running and costing money after it finishes. What's wrong?
Model answer
The restart policy is almost certainly Always, the default, so ACI restarts the container every time it exits. For a job I'd set OnFailure, so it reruns only if it fails, or Never if a failure should be looked at by a person. Then the group stops after the run and billing stops with it.
Quick revision
Key points
- ACR tiers are Basic, Standard and Premium. Premium adds geo-replication, private endpoints and the most included storage.
- You can change an ACR tier in place with az acr update --sku, with no downtime.
- Pull with a managed identity or service principal that has AcrPull. Keep the admin user disabled.
- ACI deploys a container group with fixed CPU and memory, a restart policy and optional public IP and DNS label.
- ACI doesn't autoscale. Changing CPU, memory or restart policy means deleting and recreating the group.
Important terminology
- Azure Container Registry
- A managed, private registry for container images and other OCI artifacts, reached at <name>.azurecr.io.
- Login server
- The registry's address, such as acrcontoso.azurecr.io, used in image names and when apps sign in.
- Geo-replication
- A Premium ACR feature that keeps a copy of the registry in other regions, so pulls are local and one registry name works everywhere.
- AcrPull
- The built-in role that lets an identity pull images from a registry. AcrPush also allows pushing.
- Container group
- The unit ACI deploys. One or more containers on the same host that share a lifecycle, network and storage.
- Restart policy
- What ACI does when a container exits. Always (default) restarts it, OnFailure restarts only on a non-zero exit code, Never leaves it stopped.
- Admin user
- A single shared username and password for a registry. It's off by default and should stay off for production.
Common mistakes
- Leaving the restart policy on Always for a batch job, so it loops and keeps billing.
- Expecting Container Instances to scale out under load.
- Choosing Standard ACR and then needing geo-replication or a private endpoint.
Exam tips
- "Replicate the registry to another region" = Premium ACR.
- "Run once, restart only if it fails" = restart policy OnFailure.
- "Increase memory of an existing container group" = delete and redeploy the group.
Five quick revision questions
-
1.Which ACR tier supports geo-replication?Show
Premium.
-
2.What is the default ACI restart policy?Show
Always.
-
3.Which role lets an app pull images from ACR?Show
AcrPull.
-
4.Does Azure Container Instances autoscale?Show
No. You size each container group yourself.
-
5.Which CLI command creates a container group?Show
az container create (with --cpu, --memory and --restart-policy).
Official references
Finished this lesson? Tick it off. Your progress is saved in this browser.
Next up: Provision and Scale Azure Container Apps
Lesson done? Make it stick with a quick gameSort It, Match the Pairs, Lightning Round and Who Am I? Earn XP and badges.