Provision and Scale Azure Container Apps
30-second answer
Azure Container Apps runs containers in a Container Apps environment without you managing Kubernetes. You size each replica with an allowed CPU and memory pair (on the Consumption profile, from 0.25 vCPU / 0.5 Gi to 4 vCPU / 8 Gi, always 2 Gi per vCPU). Scale rules (HTTP, TCP or event-based, such as a queue) add replicas between min replicas and max replicas. With min replicas 0 the app scales to zero when it's idle; CPU and memory rules can't do that. Changing scale settings creates a new revision.
Simulate it » No Azure account neededExam objective: 3.3.3 Provision a container by using Azure Container Apps. 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.
Open <strong>Container Apps</strong> and select <strong>+ Create → Container App</strong>.
👆 Click the glowing item in the portal to continue
Read the steps as text
- Open Container Apps and select + Create → Container App.
- Every container app lives in a Container Apps environment: a shared boundary with its own network and Log Analytics workspace.
- Size each replica with an allowed CPU and memory pair. 0.5 vCPU with 1 Gi is a good start for an API.
- External ingress gives the app a public HTTPS URL. With ingress on and no rule of your own, Container Apps scales on HTTP traffic by default.
- Review and Create.
- Open Application → Scale. Min replicas 0 means no traffic, no running replicas, no compute bill. Max replicas caps the bill on a busy day.
- Add an HTTP scaling rule: one replica per 50 concurrent requests. CPU and memory rules can’t scale to zero; HTTP, TCP and event rules can.
- Saving scale settings creates a new revision. Under load it ran 8 replicas, and it’ll scale back to zero when it’s quiet.
🧪 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
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.
🤔 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
The orders API needs 1 replica at night and 20 on sale day.
😊 THE SOLUTION
Run it in Container Apps with an HTTP scale rule and min replicas 0.
- Idle replicas cost money✓ Scale to zero
- Sale-day traffic✓ HTTP concurrency rule
- Runaway bill✓ Max replicas cap
Start with a question
How many tills should a shop open?
A supermarket on a quiet Tuesday morning opens one till. On Saturday afternoon it opens ten, and at 11 PM it closes them all. Nobody plans the exact number in advance: the manager watches the queue.
Azure Container Apps is that manager for your containers. Each open till is a replica. A scale rule watches the queue (HTTP requests, connections or messages) and opens or closes tills between a minimum and maximum you set. If the minimum is zero, the shop can close completely when nobody’s there.
Explain it like I’m 10
The technical explanation
Provision a container app in the portal
- Search Container Apps, select + Create → Container App.
- Basics: subscription, resource group, Container app name, region and a Container Apps environment (create one if needed; it brings a Log Analytics workspace for logs).
- Container: image source (Azure Container Registry, Docker Hub or another registry), image and tag, Workload profile (Consumption) and CPU and Memory.
- Ingress: turn it on for an HTTP app. Accepting traffic from anywhere gives a public URL; Limited to Container Apps Environment keeps it internal. Set the target port your container listens on.
- Review + create. Then open Application → Scale to set replicas and rules.
az containerapp env create -g rg-admin-apps -n cae-contoso-adm -l eastus
az containerapp create -g rg-admin-apps -n ca-orders-api --environment cae-contoso-adm \
--image mcr.microsoft.com/k8se/quickstart:latest --ingress external --target-port 80 \
--cpu 0.5 --memory 1.0Gi --min-replicas 0 --max-replicas 5
In PowerShell the Az.App module does the same with New-AzContainerAppManagedEnv and New-AzContainerApp, with scale rules built by New-AzContainerAppScaleRuleObject.
Sizing: CPU and memory per replica
On the Consumption profile, CPU goes from 0.25 to 4 vCPU in steps of 0.25, and memory must be 2 Gi per vCPU:
| CPU | Memory |
|---|---|
| 0.25 | 0.5Gi |
| 0.5 | 1.0Gi |
| 1 | 2.0Gi |
| 2 | 4.0Gi |
| 4 | 8.0Gi |
Need an odd shape, more memory or GPUs? Add a dedicated workload profile to the environment and run the app there. You pay for those machines whether they’re busy or not.
Scaling: replicas and rules
| Setting | Default | Notes |
|---|---|---|
| Min replicas | 0 | 0 means the app can scale to zero |
| Max replicas | 10 | Raise it (the platform allows up to 1,000) or lower it to cap cost |
| HTTP rule | 10 concurrent requests per replica when ingress is on and you add no rule | Set your own value, such as 50 |
| TCP rule | Concurrent TCP connections | |
| Custom (KEDA) | Event sources such as Azure Service Bus, Storage queues or Event Hubs | |
| CPU / memory | Utilisation-based; can’t scale to zero |
Container Apps checks the rules about every 30 seconds and waits a cool-down of 300 seconds with no load before it scales all the way back to zero.
az containerapp update -g rg-admin-apps -n ca-orders-api \
--scale-rule-name http-scale --scale-rule-type http \
--scale-rule-http-concurrency 50 --min-replicas 0 --max-replicas 10
With that rule, 400 concurrent requests give 400 ÷ 50 = 8 replicas. 1,000 requests would want 20 but stop at 10, so requests start to queue. That’s the trade-off max replicas gives you: a predictable bill.
Architect level Revisions are how changes roll out
The scale section is part of the app’s template, so saving new scale settings creates a new revision. In single revision mode the new one takes all the traffic and the old one is deactivated. In multiple revision mode you can split traffic between revisions, for example 90% and 10%, and roll back by moving the traffic. Ingress, secrets and the registry settings are app-level and don’t create a revision.
Real-world business scenario
Contoso Retail (fictional)
- The problem
- The orders API ran on three always-on VMs. They idled most nights and still fell over during the monthly flash sale.
- What they used
- Azure Container Apps on the Consumption profile: 0.5 vCPU / 1.0Gi per replica, external ingress, an HTTP scale rule at 50 concurrent requests per replica, min replicas 1 during business hours and 0 overnight through a scheduled update, max replicas 30.
- Why that choice
- Replicas follow real traffic within seconds, the night costs almost nothing, and max replicas stops a bot storm from turning into a surprise bill.
- The result
- The flash sale peaked at 26 replicas with no errors, and the monthly compute bill fell by more than half compared with the VMs.
When to use it and when not to
✓ Use it when…
- A container API or worker has traffic that rises and falls.
- You want scale to zero for apps that are idle much of the day.
- Several small services should share one environment, network and log workspace.
✕ Think twice when…
- A job runs once and stops. Container Instances is simpler.
- You need direct access to the Kubernetes API or custom controllers. Use AKS.
- A classic web app needs deployment slots and backups. App Service has them built in.
↔ Alternatives to consider
- Azure Container Instances for run-once jobs with fixed CPU and memory.
- Azure App Service for web apps with slots, custom domains and backups.
- Azure Kubernetes Service for full control of a Kubernetes cluster.
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 does "scale to zero" mean in Container Apps?
Model answer
When nobody is using the app, Container Apps can stop every replica, so you pay nothing for compute. You allow it by setting min replicas to 0. The next request starts a replica again, with a short delay the first time.
Intermediate An API should add replicas as traffic grows, up to 20. How do you set that up?
Model answer
I'd add an HTTP scale rule with a concurrent requests value, say 50 per replica, set max replicas to 20 and min replicas to 0 or 1 depending on whether a cold start is acceptable. In the CLI that's az containerapp update with --scale-rule-type http, --scale-rule-http-concurrency 50 and --max-replicas 20.
Experienced developer Why didn't my container app scale to zero with a CPU rule?
Model answer
CPU and memory rules need at least one replica running to measure anything, so they can't scale to zero. If scale to zero matters, I'd use an HTTP, TCP or event rule, such as an Azure Service Bus queue scaler, and set min replicas to 0.
Scenario The create wizard rejects 0.5 vCPU with 4 Gi of memory. Why?
Model answer
On the Consumption profile CPU and memory come in fixed pairs: memory is twice the vCPU in Gi. 0.5 vCPU goes with 1 Gi. If the app really needs 4 Gi, I'd pick 2 vCPU with 4 Gi, or move it to a dedicated workload profile.
Quick revision
Key points
- Container apps run inside a Container Apps environment; several apps share it.
- Consumption sizes go from 0.25 vCPU / 0.5 Gi to 4 vCPU / 8 Gi, always 2 Gi per vCPU.
- Scale rules can be HTTP, TCP or custom (KEDA event sources). Min and max replicas bound them.
- Min replicas 0 allows scale to zero. CPU and memory rules can't scale to zero.
- Max replicas defaults to 10. Changing scale settings creates a new revision.
Important terminology
- Container Apps environment
- The shared boundary that container apps run in, with its own virtual network and Log Analytics workspace.
- Replica
- One running copy of a container app revision. Scaling adds or removes replicas.
- Revision
- An immutable snapshot of a container app's template. Changing the image, settings or scale rules creates a new one.
- Scale rule
- The trigger that tells Container Apps when to add replicas, such as HTTP concurrency, TCP connections or a KEDA event source.
- Min replicas
- The fewest replicas that run. Zero allows scale to zero.
- Max replicas
- The most replicas that can run, which caps cost on a busy day. The default is 10.
- Workload profile
- The compute an environment offers. Consumption is serverless; dedicated profiles give reserved, larger machines.
Common mistakes
- Picking a CPU and memory pair that isn't allowed on Consumption.
- Using a CPU rule and expecting scale to zero.
- Forgetting max replicas, so a traffic spike runs up the bill.
Exam tips
- "Scale to zero when idle" = min replicas 0 with an HTTP or event rule.
- "Add a replica per N concurrent requests" = HTTP scale rule.
- "Limit the maximum cost under load" = set max replicas.
Five quick revision questions
-
1.What is the default maximum number of replicas?Show
10.
-
2.Which memory goes with 1 vCPU on the Consumption profile?Show
2 Gi.
-
3.Can a CPU scale rule scale an app to zero?Show
No.
-
4.What do scale changes create?Show
A new revision.
-
5.Which CLI flag sets HTTP concurrency for a scale rule?Show
--scale-rule-http-concurrency.
Official references
Finished this lesson? Tick it off. Your progress is saved in this browser.
Next up: App Service Plans, Scaling and Creating a Web App
Lesson done? Make it stick with a quick gameSort It, Match the Pairs, Lightning Round and Who Am I? Earn XP and badges.