Get started with autoscale in Azure
This article describes how to set up your autoscale settings for your resource in the Azure portal.
Azure Monitor autoscale applies only to Azure Virtual Machine Scale Sets, Azure Cloud Services, Azure App Service - Web Apps, and Azure API Management.
Discover the autoscale settings in your subscription
To discover all the resources for which autoscale is applicable in Azure Monitor, follow these steps.
Open the Azure portal.
Select the Azure Monitor icon at the top of the page.
Select Autoscale to view all the resources for which autoscale is applicable, along with their current autoscale status.
Use the filter pane at the top to scope down the list to select resources in a specific resource group, specific resource types, or a specific resource.
For each resource, you'll find the current instance count and the autoscale status. The autoscale status can be:
- Not configured: You haven't enabled autoscale yet for this resource.
- Enabled: You've enabled autoscale for this resource.
- Disabled: You've disabled autoscale for this resource.
You can also reach the scaling page by selecting All Resources on the home page and filter to the resource you're interested in scaling.
After you've selected the resource that you're interested in, select the Scaling tab to configure autoscaling rules.
Create your first autoscale setting
Let's now go through a step-by-step walkthrough to create your first autoscale setting.
Open the Autoscale pane in Azure Monitor and select a resource that you want to scale. The following steps use an App Service plan associated with a web app. You can create your first ASP.NET web app in Azure in 5 minutes.
The current instance count is 1. Select Custom autoscale.
Provide a name for the scale setting. Select Add a rule to open a context pane on the right side. By default, this action sets the option to scale your instance count by 1 if the CPU percentage of the resource exceeds 70 percent. Leave it at its default values and select Add.
You've now created your first scale rule. The UX recommends best practices and states that "It is recommended to have at least one scale in rule." To do so:
- Select Add a rule.
- Set Operator to Less than.
- Set Threshold to 20.
- Set Operation to Decrease count by.
You should now have a scale setting that scales out and scales in based on CPU usage.
Select Save.
Congratulations! You've now successfully created your first scale setting to autoscale your web app based on CPU usage.
Note
The same steps are applicable to get started with a Virtual Machine Scale Sets or cloud service role.
Other considerations
The following sections introduce other considerations for autoscaling.
Scale based on a schedule
You can set your scale differently for specific days of the week.
- Select Add a scale condition.
- Setting the scale mode and the rules is the same as the default condition.
- Select Repeat specific days for the schedule.
- Select the days and the start/end time for when the scale condition should be applied.
Scale differently on specific dates
You can set your scale differently for specific dates.
- Select Add a scale condition.
- Setting the scale mode and the rules is the same as the default condition.
- Select Specify start/end dates for the schedule.
- Select the start/end dates and the start/end time for when the scale condition should be applied.
View the scale history of your resource
Whenever your resource is scaled up or down, an event is logged in the activity log. You can view the scale history of your resource for the past 24 hours by switching to the Run history tab.
To view the complete scale history for up to 90 days, select Click here to see more details. The activity log opens, with autoscale preselected for your resource and category.
View the scale definition of your resource
Autoscale is an Azure Resource Manager resource. To view the scale definition in JSON, switch to the JSON tab.
You can make changes in JSON directly, if necessary. These changes will be reflected after you save them.
Cool-down period effects
Autoscale uses a cool-down period to prevent "flapping," which is the rapid, repetitive up-and-down scaling of instances. For more information, see Autoscale evaluation steps. For other valuable information on flapping and understanding how to monitor the autoscale engine, see Flapping in Autoscale and Troubleshooting autoscale, respectively.
Route traffic to healthy instances (App Service)
When your Azure web app is scaled out to multiple instances, App Service can perform health checks on your instances to route traffic to the healthy instances. To learn more, see Monitor App Service instances using Health check.
Move autoscale to a different region
This section describes how to move Azure autoscale to another region under the same subscription and resource group. You can use REST API to move autoscale settings.
Prerequisites
- Ensure that the subscription and resource group are available and the details in both the source and destination regions are identical.
- Ensure that Azure autoscale is available in the Azure region you want to move to.
Move
Use REST API to create an autoscale setting in the new environment. The autoscale setting created in the destination region will be a copy of the autoscale setting in the source region.
Diagnostic settings that were created in association with the autoscale setting in the source region can't be moved. You'll need to re-create diagnostic settings in the destination region, after the creation of autoscale settings is completed.
Learn more about moving resources across Azure regions
To learn more about moving resources between regions and disaster recovery in Azure, see Move resources to a new resource group or subscription.
Next steps
Feedback
Submit and view feedback for