Courseiva

AZ-204 Practice Question: Connect to and consume Azure services and third-party services

A developer is building a microservices application on Azure Kubernetes Service (AKS). One service needs to consume messages from an Azure Service Bus queue. The solution must minimize cost and automatically scale based on the number of messages. Which approach should the developer choose?

⚠ Common exam trap

The trap here is that candidates might choose Azure Functions (Option C) because of its built-in Service Bus trigger, overlooking that the question explicitly requires the solution to run on AKS and minimize cost, whereas Functions on a dedicated plan incurs higher cost and is not part of the AKS microservices architecture.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Use KEDA to scale the pods based on the Service Bus queue length

KEDA (Kubernetes Event-Driven Autoscaling) is the correct choice because it natively integrates with Azure Service Bus to monitor queue length and automatically scale the number of pods in AKS based on that metric. This minimizes cost by scaling to zero when there are no messages and scaling up only as needed, without requiring manual intervention or additional infrastructure.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Use KEDA to scale the pods based on the Service Bus queue length

    Why this is correct

    KEDA (Kubernetes Event-driven Autoscaling) is the optimal choice as it directly integrates with Azure Service Bus, enabling event-driven autoscaling for Kubernetes pods. It monitors the Service Bus queue length and automatically scales the number of microservice pods up or down based on the message backlog. This dynamic scaling ensures that compute resources are efficiently utilized, only consuming capacity when demand exists, which significantly optimizes operational costs and maintains application responsiveness.

  • Use Azure Event Grid to route messages to the microservice

    Why it's wrong here

    Azure Event Grid is primarily an event routing service designed for reactive programming, delivering discrete events from various sources to handlers. It is not a message queueing system; it lacks features like message persistence, guaranteed delivery, and queue length metrics that are essential for reliable message processing and autoscaling based on backlog. Therefore, using Event Grid for direct message routing to a microservice requiring queue-based scaling is an inappropriate architectural pattern.

  • Use Azure Functions with a Service Bus trigger on a dedicated App Service plan

    Why it's wrong here

    While Azure Functions can process Service Bus messages effectively, deploying them on a dedicated App Service plan means the underlying compute resources are continuously allocated and incur costs, even during periods of inactivity or when no messages are present in the queue. This approach negates the cost-efficiency benefits of true event-driven autoscaling, as it maintains a fixed resource footprint rather than dynamically scaling to zero or minimal instances during idle periods to save costs.

  • Use the Azure Service Bus SDK in the pod code and manually scale pods

    Why it's wrong here

    Relying on the Azure Service Bus SDK within the pod code to process messages, combined with manual pod scaling, is inefficient and impractical for a dynamic microservices application. Manual scaling lacks the agility to respond dynamically to fluctuating message volumes, inevitably leading to either over-provisioning and wasted resources or under-provisioning and significant processing delays. This approach introduces substantial operational overhead and fails to leverage the inherent benefits of cloud-native autoscaling capabilities.

About these practice questions

This AZ-204 question is part of Courseiva's 881-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This AZ-204 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AZ-204 exam.