AZ-104 Question 165
Single answerYou have a containerized application that processes messages from an Azure Storage queue. You plan to deploy it to Azure Container Apps and need it to automatically scale based on the queue length. Which approach should you use to enable automatic scaling in Azure Container Apps?
- A
Configure a built-in Azure Monitor autoscale setting directly on the Azure Container Apps environment
- B
Deploy the container to Azure Container Instances and manually adjust the instance count as needed
- C
Use KEDA-based scale rules in Azure Container Apps to specify a queue-based trigger
- D
Create custom metrics in Application Insights and define autoscale rules in the container app's settings
Show answer and explanation
Correct answer: C
Explanation
Azure Container Apps integrates with KEDA (Kubernetes Event-Driven Autoscaling) to handle event-driven scaling scenarios, such as automatically adjusting container replicas based on queue length. Therefore, using KEDA-based scale rules with a queue trigger is the correct and recommended approach.
- A. Incorrect.
Azure Monitor autoscale settings are not directly configured on Azure Container Apps for queue-based triggers; you use KEDA-based triggers instead.
- B. Incorrect.
Azure Container Instances does not natively provide event-driven scaling capabilities for queue triggers in the same way Azure Container Apps does.
- C. Correct.
KEDA-based scale rules in Azure Container Apps allow automatic scaling based on various event sources, including Azure Storage queues.
- D. Incorrect.
Although you can track metrics using Application Insights, creating custom metrics and hooking them into autoscale rules is more complex and not the recommended approach for queue-driven scaling in Azure Container Apps.