AZ-104 Question 166
Single answerYou have deployed a microservices application in Azure Container Apps that experiences significant CPU usage spikes during peak times. You need to implement automatic horizontal scaling based on CPU percentage to handle fluctuating traffic. Which solution should you configure to meet this requirement?
- A
Create a custom script on an Azure VM that programmatically adds or removes Container App instances using the Azure CLI.
- B
Use the Azure Container Apps scale feature and specify a CPU-based trigger within the autoscaling rules.
- C
Migrate the application to Azure Kubernetes Service (AKS) and configure the Horizontal Pod Autoscaler for CPU-based scaling.
- D
Manually adjust the Container App’s CPU and memory allocation through container instance sizing whenever traffic peaks.
Show answer and explanation
Correct answer: B
Explanation
Azure Container Apps provides built-in autoscaling capabilities through a CPU-based trigger without the complexity of manually managing or migrating to AKS. This allows for automatic horizontal scaling when CPU utilization reaches specified thresholds.
- A. Incorrect.
A custom script on a VM would be manual and not the recommended automatic scaling approach for Azure Container Apps.
- B. Correct.
Using built-in scaling features in Azure Container Apps with a CPU-based trigger is the straightforward method for automatic horizontal scaling.
- C. Incorrect.
While AKS supports autoscaling via the Horizontal Pod Autoscaler, moving the entire workload to AKS adds unnecessary overhead if you only need basic container scaling.
- D. Incorrect.
Manually adjusting resource allocation can handle changes, but it is not automated and requires ongoing manual intervention.