Skip to content
Visual explainer 3h 30m to learn 5 steps

Compare Container Apps and AKS with ACR

Choose Container Apps or AKS, push images to ACR and run revisions with ingress, autoscaling and identity.

By Invicly Tech, , in Microsoft Azure Cloud Engineering. About 14 minutes to read.

Topic 13 of 33

In short

Azure Container Registry (ACR) stores your container images privately. Azure Container Apps runs those images as a serverless platform with built-in HTTPS ingress, revisions and scaling, including down to zero. Azure Kubernetes Service (AKS) gives you a full Kubernetes cluster with more control, and with it more work: node pools, upgrades, ingress and add-ons are yours to run.

Think of it like this: Container Apps is a serviced office where you bring your desk; AKS is leasing the whole floor and hiring your own facilities team.

Explained simply

A container image is your app packed together with everything it needs to run, such as the language runtime and libraries. You build it once and run the same image on your laptop, in testing and in production. Azure Container Registry, ACR for short, is a private place in Azure to store those images, close to where they run.

Azure Container Apps runs your images without you managing servers or Kubernetes. You tell it which image to run, how much CPU and memory to give it, and whether it should accept traffic from the internet. It gives you an HTTPS address, adds copies when traffic grows and can scale down to zero when nobody uses the app.

Each time you change the image or its settings, Container Apps creates a revision, which is a frozen version of your app. By default the new revision takes all traffic once it is healthy. You can also run two revisions at once and send, say, 10 percent of users to the new one before moving everyone.

Azure Kubernetes Service, AKS, gives you a real Kubernetes cluster. Azure runs the control plane, and you get the full Kubernetes toolset. In return you look after node pools, upgrades, ingress controllers and add-ons. Pick AKS when you need that control and have people to run it; otherwise Container Apps is usually simpler.

Cost note: ACR has no free tier, so a Basic registry costs a small daily amount. Container Apps on the Consumption plan includes a monthly free grant of CPU, memory and requests. AKS nodes are VMs you pay for. A free alternative is to build and run the image locally with Docker.

Press Play on a diagram to walk through it one step at a time.

SequenceFrom build to a running Container App
Developer or pipeline
Container Registry
Container Apps
Managed identity
  1. 1az acr build pushes api:1.4.0
    Developer or pipeline to Container Registry: az acr build pushes api:1.4.0
  2. 2Update app to image api:1.4.0
    Developer or pipeline to Container Apps: Update app to image api:1.4.0
  3. 3Ask for a token
    Container Apps to Managed identity: Ask for a token
  4. 4Token with AcrPull rights
    Managed identity to Container Apps: Token with AcrPull rights
  5. 5Pull image using the token
    Container Apps to Container Registry: Pull image using the token
  6. 6New revision passes probes and takes traffic
    Container Apps to Developer or pipeline: New revision passes probes and takes traffic
CompareWho does what: Container Apps and AKS
Container Apps
  • Azure runs the cluster for you
  • Ingress, TLS and revisions built in
  • KEDA-based scaling, can scale to zero
  • No kubectl access to the cluster
  • Pay per use on the Consumption plan
AKS
  • Azure runs the control plane only
  • You pick and upgrade node pools
  • You install ingress, policies, add-ons
  • Full Kubernetes API and ecosystem
  • Pay for nodes even when idle
LayersContainer Apps building blocks
  1. 1
    Environment

    Shared boundary, VNet and Log Analytics workspace.

  2. 2
    Container app

    Ingress, secrets, identity and revision mode.

  3. 3
    Revision

    Immutable template: image, env vars, scale rules.

  4. 4
    Replica

    One running instance of a revision.

  5. 5
    Containers

    Your app container plus optional sidecars.

In depth

Images, tags and the registry

An image is identified by registry, repository and tag, such as contosoacr.azurecr.io/api:1.4.0. Tags can be moved to another image, so latest tells you nothing about what is running. Tag each build with a version or the Git commit SHA, deploy that tag, and never overwrite it. Under each tag sits a digest, a sha256 hash that names the exact image content.

ACR comes in Basic, Standard and Premium tiers. They differ in included storage and throughput; Premium adds geo-replication, private endpoints and other network controls. az acr build sends your source to ACR and builds the image there, so you do not need Docker locally. Keep the registry's admin user disabled. Pipelines push with an identity holding AcrPush, and apps pull with an identity holding AcrPull.

  • Tag with a version or commit SHA
  • Never redeploy a changed image under the same tag
  • AcrPush for pipelines, AcrPull for apps
  • Premium tier for private endpoints and geo-replication

Revisions and traffic splitting

A revision is an immutable snapshot of a container app's template: the containers, their images, environment variables, resources and scale rules. Changing any of those creates a new revision. Changing app-level configuration, such as ingress, secrets, registry credentials or the revision mode, does not.

In single revision mode, the default, a new revision gets traffic only after it has started and passed its startup and readiness probes; if it fails, traffic stays on the old one. In multiple revision mode you choose. You can keep the old revision active, send a percentage of traffic to the new one, and add labels that give a revision its own stable URL for testing. Rolling back means sending 100 percent back to the previous revision, which is still there and already warm if it has replicas.

FlowA canary release with two revisions
  1. 1
    Deploy new revision

    Multiple revision mode; new revision gets 0 percent.

  2. 2
    Test by label URL

    Smoke tests hit the new revision directly.

  3. 3
    Shift 10 percent

    Watch errors and latency in Application Insights.

  4. 4
    Shift 100 percent

    Keep the old revision active for a quick rollback.

  5. 5
    Deactivate old revision

    Once the new one is stable.

Ingress and autoscaling

Ingress decides who can reach the app. External ingress gives a public HTTPS endpoint; internal ingress makes the app reachable only from inside its Container Apps environment or connected VNet. You set the target port your container listens on, and Container Apps terminates TLS for you.

Scaling is built on KEDA, the Kubernetes event-driven autoscaler. You set minimum and maximum replicas and one or more scale rules. An HTTP rule adds replicas when concurrent requests per replica pass a threshold. A queue rule scales a worker on queue length, for example in Azure Service Bus or Storage queues. With minimum replicas 0 an idle app costs nothing for compute but the first request waits for a cold start; set it to 1 for latency-sensitive APIs.

MapScale rule types in Container Apps
Scale rules
  • HTTP
    • Concurrent requests per replica
    • For APIs
  • TCP
    • Concurrent connections
  • Custom (KEDA scaler)
    • Service Bus queue length
    • Storage queue length
    • Event Hubs lag
  • Replica bounds
    • Min 0 allows scale to zero
    • Max caps cost

Identity for pulling images and calling services

A container app can have a system-assigned identity, user-assigned identities or both. The same identity can do two jobs. First, pull images: grant it AcrPull on the registry and set it as the registry identity, so no registry password exists anywhere. Second, call other Azure services from your code: grant it a data role, such as Storage Blob Data Contributor, and use DefaultAzureCredential in the app.

A user-assigned identity is often better for image pulls. You can create it and grant AcrPull before the app exists, which avoids a first deployment that fails because the system identity was not yet allowed to pull. In AKS the equivalent tools are attaching ACR to the cluster, which grants the kubelet identity AcrPull, and Microsoft Entra Workload ID for pods that call Azure services.

  • System-assigned: created and deleted with the app
  • User-assigned: lives on its own, can be granted roles first
  • AcrPull on the registry for image pulls
  • Data roles plus DefaultAzureCredential for app calls

What you take on with AKS

With AKS, Azure runs the Kubernetes control plane. The Free tier has no financially backed uptime SLA for it; the Standard tier adds one. Everything that runs your workloads is yours to plan: node pool sizes and counts, the cluster autoscaler, Kubernetes version upgrades on the supported schedule, node image updates, an ingress controller, network policy, monitoring add-ons and backups of cluster state. AKS Automatic presets many of these choices for teams that want Kubernetes with fewer decisions.

In return you get the full Kubernetes API, any Helm chart or operator, DaemonSets, custom networking and fine control over scheduling. A useful rule: if your team does not already run Kubernetes and you do not need its API, start with Container Apps. You can move to AKS later, because the image is the same.

Learn it in 5 short steps

About 40m each. Track them with a timer in your plan.

  1. 1
    Push an image to ACR~40m
  2. 2
    Deploy a Container App revision~40m
  3. 3
    Configure ingress and scaling~40m
  4. 4
    Pull images with a managed identity~40m
  5. 5
    Compare AKS responsibilities~40m

Key points

  • Tag images with a version or commit SHA and deploy that exact tag; avoid relying on latest.
  • Let the app pull from ACR with a managed identity holding AcrPull, and keep the ACR admin user disabled.
  • In Container Apps, changes to the template (image, scale rules) create a new revision; ingress and secrets do not.
  • Scale rules can use HTTP concurrency, queue length or other KEDA scalers; minimum replicas 0 allows scale to zero.
  • Choose AKS when you need the Kubernetes API, custom operators or fine control, and have people to run it.

Key terms

Tap a card to flip it. 0/6 known

Examples

bash
az acr build -r contosoacr -t api:1.4.0 .

az containerapp create -g rg-lab-compute -n api \
  --environment cae-lab \
  --image contosoacr.azurecr.io/api:1.4.0 \
  --registry-server contosoacr.azurecr.io \
  --registry-identity system \
  --ingress external --target-port 8000 \
  --min-replicas 0 --max-replicas 5

az containerapp revision list -g rg-lab-compute -n api -o table

Builds the image in ACR, then runs it with a system-assigned identity that pulls without a password.

Build, push and run the sample API

Prerequisites: a lab resource group with a budget alert, and a Dockerfile for an API listening on port 8000. Step 1: create a Basic registry and build the image in ACR. Step 2: create a Container Apps environment. Step 3: create the app with a system identity used for the image pull. Evidence: az containerapp show prints the FQDN, curl to /health returns 200, and the revision list shows one healthy revision. Cleanup: delete the resource group, which removes the registry too.

bash
az acr create -g rg-lab-aca -n contosoacr$RANDOM --sku Basic
ACR=$(az acr list -g rg-lab-aca --query "[0].name" -o tsv)
az acr build -r $ACR -t api:1.4.0 .
az containerapp env create -g rg-lab-aca -n cae-lab -l westeurope
az containerapp create -g rg-lab-aca -n api --environment cae-lab \
  --image $ACR.azurecr.io/api:1.4.0 --registry-server $ACR.azurecr.io \
  --registry-identity system --ingress external --target-port 8000 \
  --min-replicas 1 --max-replicas 5
FQDN=$(az containerapp show -g rg-lab-aca -n api --query properties.configuration.ingress.fqdn -o tsv)
curl -s -o /dev/null -w "%{http_code}\n" https://$FQDN/health

Send 20 percent of traffic to a new revision

Step 1: switch the app to multiple revision mode. Step 2: deploy image 1.5.0 with a revision suffix so the name is predictable. Step 3: split traffic 80/20 between the old and new revisions, using the names from the revision list. Step 4: watch failures for the new revision. Evidence: the ingress traffic list shows the weights. Rollback: set the old revision back to 100.

bash
az containerapp revision set-mode -g rg-lab-aca -n api --mode multiple
az containerapp update -g rg-lab-aca -n api \
  --image $ACR.azurecr.io/api:1.5.0 --revision-suffix v150
az containerapp revision list -g rg-lab-aca -n api --query "[].name" -o tsv
az containerapp ingress traffic set -g rg-lab-aca -n api \
  --revision-weight <old-revision>=80 <new-revision>=20
az containerapp ingress traffic show -g rg-lab-aca -n api -o table

Quick reference

  • az acr build -r contosoacr -t api:1.4.0 . builds in Azure, no local Docker needed
  • Grant AcrPull to the app identity; keep the ACR admin user disabled
  • Template changes (image, env vars, scale rules) create a new revision
  • Ingress, secrets and revision mode are app-scope and do not create a revision
  • --min-replicas 0 allows scale to zero but adds cold starts
  • Multiple revision mode plus traffic weights gives canary and blue-green releases
  • AKS: you own node pools, upgrades, ingress controller and add-ons

Common mistakes

  • Enabling the ACR admin user and pasting its password into the app. Use a managed identity with AcrPull instead.
  • Setting minimum replicas to 0 for an API that must answer instantly. The first request after idle waits for a cold start.
  • Picking AKS for one small API. You take on node upgrades and cluster add-ons for little benefit.

Quick quiz

Pick an answer to see if you're right and why.

Question 1

1Why should you avoid deploying the latest tag?

Question 2

2Which change creates a new Container Apps revision?

Question 3

3A worker should run only when its Service Bus queue has messages. What do you configure?

Question 4

4Which is a responsibility you take on with AKS but not with Container Apps?

Question 5

5Why is a user-assigned identity handy for image pulls?

0/5 answered

Practice exercises

Try each one yourself first. Use the hint if you get stuck, then compare with the solution.

  1. Exercise 1easy

    List the repositories and tags in your registry and show the digest of api:1.4.0.

  2. Exercise 2medium

    Give the api app an HTTP scale rule of 50 concurrent requests, between 1 and 10 replicas, and confirm a new revision was created.

  3. Exercise 3hard

    Replace the system identity pull with a user-assigned identity created first, then roll out a new image with no registry password anywhere.

Check yourself

Answer in your head, reveal, then be honest with yourself.

Feel confident about this topic?

Frequently asked questions

Is Azure Container Apps built on Kubernetes?
Yes, it runs on Kubernetes with KEDA and Envoy underneath, but you do not get access to the Kubernetes API. You work with apps, revisions and scale rules instead.
Can I use Docker Hub instead of ACR?
Yes, Container Apps can pull from any registry. ACR keeps images private and close to your app and lets you pull with a managed identity instead of a password.
When is AKS worth the extra work?
When you need the Kubernetes API, Helm charts or operators, special networking or scheduling, or you already run Kubernetes elsewhere and want one way of working.
Does Container Apps charge for idle apps?
On the Consumption plan an app scaled to zero has no running replicas and no compute charge. With minimum replicas above zero, idle replicas are billed at a lower idle rate.

Go deeper

ShareXLinkedInWhatsApp