Microsoft Azure · Networking & Containers

Azure Container Apps

Azure Container Apps runs your containers with automatic scaling and HTTPS, without you having to manage a Kubernetes cluster.

Intermediate 5 min Lesson 19 of 28
Before you start:DevOps: Docker
0/28 in Microsoft Azure
On this page · 5 min · Intermediate

Learning objectives#

  • Deploy a container app from source or an image
  • Configure ingress and scaling
  • Use revisions for safe releases
  • Pass configuration and secrets

Explanation#

Container apps live in an environment, which provides shared networking and logging. Under the hood it runs on Kubernetes, but you never touch the cluster.

Ingress makes an app reachable over HTTPS; set it to external for public APIs or internal for services called only by other apps.

Scaling rules (HTTP traffic, queue length, CPU and more) scale replicas up and down — including to zero.

Each deployment can create a revision. You can split traffic between revisions for blue-green or canary releases.

Code example: Deploy an API from source#

ShellDeploy an API from source Illustrative
az containerapp up --name ca-shop-api --resource-group rg-shop-dev \
  --location centralindia --source . \
  --ingress external --target-port 8080 \
  --env-vars ASPNETCORE_ENVIRONMENT=Development


az containerapp update -n ca-shop-api -g rg-shop-dev --min-replicas 0 --max-replicas 5
az containerapp show -n ca-shop-api -g rg-shop-dev --query properties.configuration.ingress.fqdn -o tsv
Expected output
ca-shop-api.<random>.centralindia.azurecontainerapps.io — the API is live over HTTPS and scales between 0 and 5 replicas.

This example is illustrative. Copy or download it and run it in your own environment; the expected output is shown above.

Step-by-step explanation#

  1. containerapp up builds the image from your Dockerfile, pushes it to a registry and deploys it.
  2. External ingress gives a public HTTPS URL; target port is the port your container listens on.
  3. min-replicas 0 allows scale to zero when idle.
  4. The fqdn is the app’s public address.

Real-world use case#

Microservices and APIs that need containers but not the complexity of AKS: an orders API, a background worker scaling on queue length, a scheduled job.

Common mistakes#

Wrong target port

If the container listens on 8080 but ingress targets 80, health checks fail. .NET 8+ images listen on 8080 by default.

Secrets as plain environment variables

Store sensitive values as container app secrets or Key Vault references.

Best practices#

  • Use managed identity to pull images and read secrets
  • Use revisions and traffic splitting for releases
  • Scale on the signal that matters (HTTP, queue length)
  • Send logs to Log Analytics

Remember this#

Containers without managing Kubernetes.

Ingress external = public URL. Target port = what your container listens on.

Revisions + traffic split = safe releases.

Practice exercise#

Your task: Send 20% of traffic to the latest revision and 80% to the previous one.

Show solution
Shell Illustrative
az containerapp revision set-mode -n ca-shop-api -g rg-shop-dev --mode multiple
az containerapp ingress traffic set -n ca-shop-api -g rg-shop-dev --revision-weight latest=20 <previous-revision-name>=80

Mini quiz#

Azure Container Apps quizMultiple choice Question 1 of 1

Can Azure Container Apps scale to zero replicas?

Score so far: 0/0

Want more? Practise all Microsoft Azure MCQs · Microsoft Azure interview questions

My notes#

Saved in this browser.

Progress is saved in this browser. Sign in to sync.