0Pricing
Cloud & IT Cert Prep · Lesson

Azure Container Apps

Deploy a microservices application to Azure Container Apps with Dapr sidecar integration, configure ingress, and use KEDA-based autoscaling triggered by Service Bus queue depth.

Azure Container Apps is a free Cloud & IT Cert Prep lesson on CoddyKit — lesson 3 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Cloud & IT Cert Prep learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

What Are Azure Container Apps?

Azure Container Apps (ACA) is a fully managed serverless container hosting service built on top of Kubernetes and KEDA (Kubernetes Event-Driven Autoscaling). Unlike AKS, you do not manage the control plane, node pools, or Kubernetes manifests directly. Instead, you deploy containers using a simple CLI or YAML definition, and Azure handles all the orchestration. ACA is ideal for microservices, API backends, event-driven workers, and background processing jobs that need to scale dynamically, including scale-to-zero.

Container Apps Environments

A Container Apps Environment is the isolated boundary within which one or more Container Apps run. All apps in an environment share the same virtual network and Log Analytics workspace. Environments are scoped to a region and a resource group. You can deploy multiple environments for isolation between teams or stages (production vs. staging). An environment can optionally be VNet-injected into your own virtual network to allow private communication between Container Apps and other Azure services without going through the public internet.

# Create a Container Apps environment
az containerapp env create \
  --name myACAEnvironment \
  --resource-group myRG \
  --location eastus

Deploying a Container App

To deploy a Container App, you specify the container image (from Azure Container Registry or any public registry), the number of replicas, and environment variables. The app is publicly accessible via an auto-generated HTTPS URL if you enable external ingress. Ingress configuration includes the target port, traffic split for blue-green deployments, and whether to allow HTTP or HTTPS only. ACA pulls the image at deployment time; the environment must have pull permissions on the registry.

# Deploy a container app from Azure Container Registry
az containerapp create \
  --name myapi \
  --resource-group myRG \
  --environment myACAEnvironment \
  --image myacr.azurecr.io/myapi:latest \
  --target-port 8080 \
  --ingress external \
  --registry-server myacr.azurecr.io \
  --min-replicas 1 \
  --max-replicas 10

KEDA-Based Autoscaling

Container Apps scales using KEDA scalers that trigger based on external metrics. Built-in KEDA scalers include: HTTP traffic (concurrent requests per replica), Azure Service Bus queue depth (messages waiting), Azure Storage Queue, Cron (time-based), and CPU/Memory. When the scaler metric falls to zero and minReplicas is set to 0, Container Apps scale to zero — incurring no compute cost until new requests arrive. Scale-to-zero is excellent for event-driven workers that have sporadic workloads.

# Scale based on Service Bus queue depth
az containerapp update \
  --name myworker \
  --resource-group myRG \
  --scale-rule-name sbqueue-scaler \
  --scale-rule-type azure-servicebus \
  --scale-rule-metadata 'queueName=orders' 'namespace=myservicebusns' 'messageCount=5' \
  --scale-rule-auth 'connection=servicebus-connection-secret:connection' \
  --min-replicas 0 \
  --max-replicas 20

Dapr Integration

Dapr (Distributed Application Runtime) is a portable, event-driven runtime that simplifies building microservices. Container Apps has native Dapr integration — you enable it per app with a single flag. Dapr provides building blocks for: service invocation (with retry and mTLS), pub/sub messaging (abstracting Service Bus, Event Hubs), state management (abstracting Redis, Cosmos DB), and output bindings. With Dapr, microservices communicate through the Dapr sidecar without knowing the underlying infrastructure details.

# Enable Dapr on a Container App
az containerapp update \
  --name myapi \
  --resource-group myRG \
  --enable-dapr \
  --dapr-app-id myapi \
  --dapr-app-port 8080 \
  --dapr-app-protocol http

Revisions and Traffic Splitting

Every deployment to a Container App creates a new revision. In multiple-revision mode, you can split traffic between revisions for blue-green or canary deployments. For example, send 10% of traffic to a new revision and 90% to the current stable revision. Monitor error rates and latency on the new revision before increasing its traffic weight to 100%. Old revisions can be deactivated but are retained in history, allowing instant rollback by shifting traffic weight back.

# Set traffic split between two revisions
az containerapp ingress traffic set \
  --name myapi \
  --resource-group myRG \
  --revision-weight myapi--abc123=90 myapi--def456=10

Secrets and Environment Variables

Container Apps supports two ways to inject configuration: environment variables (for non-sensitive config like feature flags or API URLs) and secrets (for sensitive values like connection strings). Secrets are stored at the Container App level and referenced by environment variables or Dapr components. For the most secure setup, reference secrets from Azure Key Vault using a managed identity, so the secret value is fetched at runtime and never stored in the Container App's configuration plane.

# Add a secret to a Container App
az containerapp secret set \
  --name myapi \
  --resource-group myRG \
  --secrets 'db-password=supersecretpassword'

# Reference the secret as an environment variable
az containerapp update \
  --name myapi \
  --resource-group myRG \
  --set-env-vars 'DB_PASSWORD=secretref:db-password'

Jobs: Run-to-Completion Workloads

Container Apps Jobs extend the platform to support run-to-completion workloads — containers that start, do work, and exit. Jobs support three trigger types: Manual (triggered via API or CLI), Scheduled (cron expression), and Event-driven (KEDA scaler triggers each execution). Jobs are billed only for actual execution time and are ideal for batch processing, report generation, database migrations, and ML inference pipelines that run periodically or in response to events.

# Create a scheduled Container Apps job (run every hour)
az containerapp job create \
  --name my-batch-job \
  --resource-group myRG \
  --environment myACAEnvironment \
  --trigger-type Schedule \
  --cron-expression '0 * * * *' \
  --image myacr.azurecr.io/batchjob:latest \
  --cpu 0.5 --memory 1Gi

Observability: Logs and Metrics

Container Apps sends system logs (platform events like revision creation and scaling) and console logs (your application's stdout/stderr) to the Log Analytics workspace attached to the environment. Query logs with KQL: ContainerAppConsoleLogs_CL | where ContainerAppName_s == 'myapi' | project TimeGenerated, Log_s. Built-in Azure Monitor metrics include replica count, request count, request latency, and CPU/memory utilisation per replica — all available in the Azure portal without any additional configuration.

# Stream live logs from a Container App
az containerapp logs show \
  --name myapi \
  --resource-group myRG \
  --follow

ACA vs. AKS vs. App Service

Choosing the right Azure container platform: Container Apps is best for microservices, event-driven workers, and APIs where you want Kubernetes benefits without managing the cluster — especially when scale-to-zero is valuable. AKS is best when you need full Kubernetes control, custom operators, or specific node configurations (GPU, high memory). App Service is best for traditional web applications and APIs where the developer team prefers a simple PaaS model without container management overhead. All three support containers; the distinction is management complexity versus control.

Networking: Internal and External Ingress

Container Apps supports two ingress modes: External (publicly reachable via a load-balanced HTTPS endpoint with automatic TLS) and Internal (only reachable from within the same Container Apps environment or from VNet-peered resources). Internal ingress is used for backend services that should never be exposed to the internet. Apps can call each other using the auto-generated internal DNS name http://myapi within the same environment, enabling simple service-to-service communication without deploying an API gateway.

Quick Check

Test your understanding of Microsoft Azure Fundamentals (AZ-900) concepts from this lesson.

Lesson Recap

In this lesson you learned: Azure Container Apps provides serverless container hosting built on Kubernetes and KEDA without cluster management, KEDA scalers enable scale-to-zero based on queue depth, HTTP traffic, or cron schedules, and Dapr integration simplifies microservice-to-microservice communication and state management. Next up we connect everything into a complete end-to-end developer workflow.

Frequently asked questions

Is the “Azure Container Apps” lesson free?

Yes — the full text of “Azure Container Apps” is free to read here on the web, and the Cloud & IT Cert Prep course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Cloud & IT Cert Prep course, upgrade to CoddyKit PRO.

What will I learn in “Azure Container Apps”?

Deploy a microservices application to Azure Container Apps with Dapr sidecar integration, configure ingress, and use KEDA-based autoscaling triggered by Service Bus queue depth. You practise Cloud & IT Cert Prep with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Cloud & IT Cert Prep?

No prior experience is required. Cloud & IT Cert Prep on CoddyKit is structured for beginners through advanced learners; this is — lesson 3 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Azure Container Apps” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Cloud & IT Cert Prep lesson?

Yes. Every Cloud & IT Cert Prep lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Managed Identity for Passwordless Auth
  2. Azure Service Bus for Decoupled Messaging
  3. Azure Container Apps
  4. End-to-End Developer Workflow
← Back to Cloud & IT Cert Prep