Run containerized apps on Azure: push images to Azure Container Registry, run them serverlessly on Azure Container Apps with autoscaling, and understand when to reach for AKS (managed Kubernetes) instead.
Containers package an app with everything it needs to run. Azure gives you: ACR (a registry to store images), Container Apps (run containers serverlessly, no cluster to manage), Container Instances (a single quick container), and AKS (managed Kubernetes). Why: Container Apps is the simplest path; AKS is for teams already invested in Kubernetes.
echo "ACR = store container images"echo "Container Apps = run containers serverlessly with autoscaling"echo "AKS = managed Kubernetes, for the Kubernetes ecosystem"Azure Container Registry (ACR) is a private Docker registry in your account. Why: Container Apps and AKS pull images from somewhere — ACR is the secure, Azure-integrated place to push them. You can even build images in the cloud with az acr build.
Create a registry (name must be globally unique, alphanumeric)
az acr create --resource-group learn-rg \
--name learnacr7f3k --sku BasicBuild an image from a local Dockerfile directly in ACR (no local Docker)
az acr build --registry learnacr7f3k \
--image my-app:latest .A Container Apps "environment" is the secure boundary your apps run in, sharing networking and logging. Why: you create it once, then run multiple container apps inside it. It is the managed foundation that means you never touch a VM or Kubernetes node.
Register the provider (first time only), then create an environment
az extension add --name containerapp --upgradeaz containerapp env create \
--resource-group learn-rg \
--name learn-cae \
--location eastusA container app runs your image with HTTP ingress, scaling, and revisions handled for you. Why serverless: you specify the image and how much CPU/memory, and Azure runs it — scaling to zero when idle so you pay nothing between requests.
Deploy the image from ACR as a public container app
az containerapp create \
--resource-group learn-rg \
--name web-app \
--environment learn-cae \
--image learnacr7f3k.azurecr.io/my-app:latest \
--registry-server learnacr7f3k.azurecr.io \
--target-port 80 --ingress external \
--min-replicas 0 --max-replicas 5The command prints the app's public FQDN to open in a browser.
Container Apps scale on rules — HTTP concurrency, CPU, or queue length — and can scale to zero. Why: you set "add a replica per 50 concurrent requests" and Azure adds and removes copies automatically, matching capacity to traffic without you managing servers.
Scale based on concurrent HTTP requests (50 per replica)
az containerapp update --resource-group learn-rg --name web-app \
--min-replicas 1 --max-replicas 10 \
--scale-rule-name http-rule \
--scale-rule-type http \
--scale-rule-http-concurrency 50Azure Kubernetes Service (AKS) runs the Kubernetes control plane for you. Why choose it: if your team already uses Kubernetes tooling (kubectl, Helm, existing manifests) or needs its portability across clouds. Note: it is more moving parts than Container Apps — reach for it when you specifically want Kubernetes.
Create a small cluster (takes several minutes)
az aks create --resource-group learn-rg --name learn-aks \
--node-count 2 --generate-ssh-keysFetch credentials so kubectl talks to it, then run normal Kubernetes
az aks get-credentials --resource-group learn-rg --name learn-akskubectl get nodeskubectl create deployment web --image=nginxkubectl get pods