A company hosts a critical Web API on an Azure App Service Web App that currently runs on the Shared (D1) pricing tier. The API experiences sudden CPU spikes during nightly batch processing jobs, leading to performance degradation. You must implement an automated scaling strategy that meets the following requirements:
- Automatically scales out up to 10 instances during high CPU load.
- Scales in to minimize costs when the load subsides.
- Prevents autoscale flapping.
- Minimizes administrative overhead by using the Azure CLI.
Which four actions should you perform in sequence? To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order.
- 1Run `az appservice plan update --name AetheriaPlan --resource-group AetheriaRG --sku S1` to scale the plan to the Standard tier.
- 2Run `az monitor autoscale create --resource-group AetheriaRG --resource AetheriaPlan --resource-type Microsoft.Web/serverfarms --name AetheriaAutoscale --min-count 1 --max-count 10 --count 1` to initialize the autoscale setting.
- 3Run `az monitor autoscale rule create --resource-group AetheriaRG --autoscale-name AetheriaAutoscale --condition "CpuPercentage > 80 avg 10m" --scale out 1` to define the scale-out trigger.
- 4Run `az monitor autoscale rule create --resource-group AetheriaRG --autoscale-name AetheriaAutoscale --condition "CpuPercentage < 30 avg 10m" --scale in 1` to define the scale-in trigger.
Answer
The correct sequence of actions is: First, scale the App Service Plan to the S1 tier; second, initialize the autoscale setting targeting the plan; third, add the scale-out rule for CPU usage above 80%; and fourth, add the scale-in rule with a 30% CPU threshold to prevent flapping.
The correct sequence begins by scaling the App Service Plan to the Standard (S1) tier, as the Basic and Shared tiers do not support custom autoscale features. Next, the autoscale setting must be created for the App Service Plan before rules can be assigned. The scale-out rule is then added to monitor for CPU spikes. Finally, a scale-in rule is configured with a threshold of 30% CPU utilization, which prevents flapping because it is sufficiently low compared to the scale-out threshold.
Step-by-Step Solution
Key Concept
Configuring Azure App Service plan autoscaling rules via CLI, ensuring the correct pricing tier is selected, and configuring appropriate scale-in thresholds to avoid autoscale flapping.