Container Apps KEDA Scaling with Service Bus Queue Workers
Scale Azure Container Apps from zero to five replicas using KEDA and Service Bus queue message count as the scaling trigger.

Lab overview
Modern event-driven architectures often rely on message queues to decouple producers from consumers, but a static pool of worker containers wastes money during quiet periods and buckles under sudden traffic spikes. KEDA (Kubernetes Event-driven Autoscaling) solves this by watching external event sources - such as Azure Service Bus queue depth - and dynamically adjusting replica counts, including scaling all the way down to zero when there is no work to process.
Azure Container Apps has KEDA built in, so you can attach a scale rule to any container app without managing a Kubernetes cluster yourself. In this lab, you will deploy a queue-worker container to a Container Apps environment, configure a KEDA scale rule that targets the Service Bus queue's messageCount metric, flood the queue with over 200 messages to trigger a burst scale-out from zero to five replicas, and then observe the workers drain the queue and scale back to zero.
Objectives
By completing this intermediate lab, you will be able to:
- Build and push a queue-worker container image to Azure Container Registry
- Deploy a Container App with a KEDA scale rule targeting Service Bus queue messageCount
- Generate a burst of 200+ messages on the Service Bus queue using a sender script
- Monitor replica scale-out from zero to five in real time using Azure CLI and the portal
- Observe scale-to-zero behavior after the queue is fully drained
Who is this lab for?
This lab is designed for:
- Cloud engineers learning event-driven autoscaling patterns on Azure
- Developers building asynchronous workload processors with Container Apps
- DevOps engineers implementing scale-to-zero architectures for cost optimization
Verified against your live environment
An automated validation engine inspects your actual resources and configurations as you work. Completion means the task was performed — not multiple choice, real-world proficiency.
More labs like this
Containerize and Deploy a Multi-Container Application to Azure Container Apps
Build Docker images for a restaurant menu app, push to ACR, and deploy frontend and backend containers to Azure Container Apps.
Build an Event-Driven Messaging Solution with Azure Service Bus
Create Service Bus queues and topics, build producer-consumer messaging, implement subscription filters, and handle dead-letter queues.
Containerize and Deploy a Web Application to Azure Container Apps
Write a Dockerfile, build and push an image to Azure Container Registry, and deploy to Azure Container Apps.
Related reading
Environment
Every lab includes
- Real environment, pre-credentialed
- Automated checks on every step
- Isolated sandbox, auto cleanup
- AI-recommended next steps
Lab curriculum
- 01
Logging into Azure CLI
- 02
Build and Push the Worker Image to Azure Container Registry
1 automated check
- 03
Deploy a Container App with a KEDA Service Bus Scale Rule
1 automated check
- 04
Flood the Queue and Observe KEDA Scaling Behavior
1 automated check
Skills validated
Not the lab you were looking for?
Browse 150+ hands-on labs across AWS, Azure, Kubernetes, Docker, and cloud security.