You manage a web application named EduLearn that is currently hosted on a Free () App Service plan. During peak hours, the application experiences high CPU utilization and becomes slow. You want to implement an automated scaling solution to handle the load and ensure the application remains responsive, while also preventing autoscale flapping. You plan to configure these settings via the Azure CLI.
How should you order the steps to configure the autoscaling solution?
- 1Upgrade the App Service plan from to Standard () using the `az appservice plan update` command.
- 2Create an autoscale setting for the App Service plan using the `az monitor autoscale create` command, specifying the minimum, maximum, and default instance counts.
- 3Add a scale-out rule to the autoscale setting using the `az monitor autoscale rule create` command, targeting a CPU metric threshold of greater than over a -minute duration.
- 4Add a scale-in rule to the autoscale setting using the `az monitor autoscale rule create` command, targeting a CPU metric threshold of less than over a -minute duration to prevent flapping.
Answer
The correct sequence starts with upgrading the App Service plan to Standard (), creating the autoscale setting container, adding the scale-out rule, and finally adding the scale-in rule.
The correct order requires first scaling up the App Service plan from the Free () tier to the Standard () tier. Autoscaling is not supported on Free or Shared plans. Once upgraded, you must create the autoscale setting container using `az monitor autoscale create`. Only after the autoscale setting is created can you add specific rules to it. The scale-out rule (CPU > ) should be added first to define the upper performance boundary, followed by the scale-in rule with a threshold of . Setting the scale-in threshold to (which is significantly lower than the scale-out threshold of ) prevents autoscale flapping.
Step-by-Step Solution
Key Concept
To configure autoscale on Azure App Service, the App Service plan must be scaled up to a supported tier (Standard or higher) before creating the autoscale setting and defining the scale-out and scale-in rules. To prevent autoscale flapping, the scale-in threshold must be significantly lower than the scale-out threshold.