
Azure Autoscaling is a game-changer for businesses that need to scale their resources on the fly. With Azure Autoscaling, you can automatically adjust the number of virtual machines, storage, and other resources based on demand.
Azure Autoscaling can be used to scale resources based on metrics such as CPU utilization, memory usage, and network traffic. This means you can set up rules to automatically add or remove resources based on specific conditions.
The benefits of Azure Autoscaling are numerous, including cost savings, improved performance, and increased reliability. By scaling resources only when needed, you can avoid wasting resources and reduce costs.
Azure Autoscaling can be set up using Azure Monitor, Azure Virtual Machine Scale Sets, and Azure Kubernetes Service (AKS). These tools provide a comprehensive solution for scaling resources and ensuring optimal performance.
Azure Autoscaling Basics
You can create your first autoscale setting in Azure Monitor in just a few minutes. To do this, open the Autoscale pane and select a resource, such as an App Service plan associated with a web app.
For your interest: Azure App Insights vs Azure Monitor
The current instance count is 1, so you'll need to select Custom autoscale. You can then enter a Name and Resource group or use the default.
To scale based on a metric, select Scale based on a metric and then Add a rule to open a context pane. The default rule scales your resource by one instance if the Percentage CPU metric is greater than 70 percent.
You can also add a scale-in rule by setting Operator to Less than and Metric threshold to trigger scale action to 20. This will decrease the count by one instance when CPU usage is below 20 percent.
To change the instance limits, go to Instance limits and set Maximum to 3. This will allow for up to 3 instances when CPU usage is high.
Here are the key steps to create your first autoscale setting:
- Open the Autoscale pane and select a resource.
- Select Custom autoscale.
- Enter a Name and Resource group or use the default.
- Select Scale based on a metric.
- Add a rule with the default settings for scale-out and scale-in.
- Set Operator to Less than for scale-in rule.
- Set Metric threshold to trigger scale action to 20 for scale-in rule.
- Set Operation to Decrease count by for scale-in rule.
- Change instance limits to Maximum 3.
Here's an interesting read: Digital Strategy Nashville
Setup and Configuration
You can set up autoscale via the Azure portal, PowerShell, cross-platform command-line interface (CLI), or Azure Monitor REST API. Autoscale allows you to scale your resources based on various metrics, such as CPU usage or time schedules.

To create your first autoscale setting, open the Autoscale pane in Azure Monitor and select a resource that you want to scale. Follow the steps outlined in the Azure portal to create a custom autoscale setting.
To configure time-based autoscaling, create a resource group using the Azure CLI, then create a virtual machine scale set. You can create a default autoscale profile and attach it to the virtual machine scale set, and then create separate autoscaling profiles to scale out and in based on a time schedule.
Here are the ways to set up autoscale:
- Azure portal
- PowerShell
- Cross-platform command-line interface (CLI)
- Azure Monitor REST API
To create a time-based autoscaling profile, use the Azure CLI to create a recurrence profile with a specific start and end time. For example, you can scale out a virtual machine scale set every day at 12:25 PM PST and scale in at 12:40 PM PST.
Types of Scaling
There are two main types of autoscaling: Time-Based Autoscaling and Metrics-Based Autoscaling.

Time-Based Autoscaling is a type of scaling that is based on scheduled time. This means you can configure rules to spin up and shut down virtual machines during specific times of the day, week, or month when demand is high.
Metrics-Based Autoscaling, on the other hand, enables scaling based on key performance metrics of your resource, such as CPU, Memory, Thread Count, etc.
Here are the two types of autoscaling in a concise list:
- Time-Based Autoscaling: scaling based on scheduled time
- Metrics-Based Autoscaling: scaling based on key performance metrics
In Azure, you can use Time-Based Autoscaling to predict and prepare for high demand periods, and Metrics-Based Autoscaling to dynamically adjust to changing resource needs.
Setup
To set up autoscale, you can use the Azure portal, PowerShell, cross-platform command-line interface (CLI), or Azure Monitor REST API. You can also discover the autoscale settings in your subscription by opening the Azure portal, searching for Azure Monitor, and selecting Autoscale.
You can set up autoscale for Azure Virtual Machines using Virtual Machine Scale Sets (VMSS), Azure Service Fabric, Azure App Service, Azure Cloud Services, and Azure Functions. However, Azure Functions does not require Azure Monitor as compute power is automatically allocated based on workloads.
Suggestion: Monitoring Azure

To create your first autoscale setting, open the Autoscale pane in Azure Monitor and select a resource that you want to scale. Select Custom autoscale and enter a Name and Resource group or use the default. You can also set up autoscale via the Azure portal, PowerShell, or cross-platform command-line interface (CLI).
You can scale based on a metric, such as CPU usage, or use a custom schedule. To scale based on a metric, select Scale based on a metric and add a rule to define your scale-out and scale-in rules. You can also set up autoscale to scale out and scale in based on a time schedule.
To discover the autoscale settings in your subscription, follow these steps:
- Open the Azure portal.
- Search for and select Azure Monitor using the search bar 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 select resources a specific resource group, resource types, or a specific resource.
You can also use the filter pane to select resources a specific resource group, resource types, or a specific resource. The page shows the instance count and the autoscale status for each resource.
Resource Management
Resource Management is crucial for Azure Autoscaling, as it helps manage the resources allocated to your application.
Azure Autoscaling can automatically scale your resources based on demand, ensuring you only pay for what you use.
This means you can save up to 90% on costs compared to a fixed resource allocation.
Resource Metrics
Resource metrics play a crucial role in autoscale rules to trigger scale events. They help determine when to scale up or down based on the performance of your resources.
Virtual machine scale sets use telemetry data from Azure diagnostics agents to generate metrics. This data is essential for making informed decisions about scaling your resources.
Some commonly used metrics include CPU usage, memory usage, thread counts, queue length, and disk usage. These metrics provide valuable insights into the performance of your resources.
For a list of available metrics, see Autoscale Common Metrics. This resource will give you a comprehensive understanding of the metrics available for use in your autoscale rules.
Additional reading: Azure Data Studio vs Azure Data Explorer
In general, metrics-based autoscaling is the most effective way to scale resources based on their performance. It allows you to scale up or down based on specific metrics, such as CPU usage or memory usage.
Here are some examples of commonly used metrics:
Move
You can move autoscale settings to a different region under the same subscription and resource group.
To do this, you can use the REST API.
If you're moving autoscale settings, you'll also need to recreate diagnostic settings in the destination region.
Diagnostic settings created in association with the autoscale setting in the source region can't be moved.
This means you'll have to start fresh with diagnostic settings in the new region once the autoscale settings are moved.
Scaling with Virtual Machine Scale Sets
Scaling with Virtual Machine Scale Sets is a powerful way to manage your Azure resources. You can group multiple virtual machines into a scale set, which allows for centralized control over their creation, integration with load balancers, and automatic distribution across Availability Zones or Sets.

Virtual Machine Scale Sets can be auto-scaled based on factors such as host metrics, in-guest metrics, Application Insights, or a custom schedule. This means you can easily adjust the number of virtual machines to meet changing demands.
Azure Monitor is used for auto-scaling in Azure Virtual Machines, Azure Service Fabric, Azure App Service, and Azure Cloud Services. Additionally, autoscaling is also available in Azure Functions, which automatically allocates compute power based on workloads.
Using Virtual Machine Scale Sets can simplify the management of multiple virtual machines. You can automate the creation of virtual machines, integrate with load balancers, and distribute instances across Availability Zones or Sets for redundancy and high availability.
Here are some of the key benefits of using Virtual Machine Scale Sets:
- Centralized control for automating the creation of virtual machines
- Automated process of creating and integrating with Azure load balancer or Application Gateway
- Automatic distribution of virtual machine instances across Availability Zones or Availability Sets
- Auto-scaling based on factors such as host metrics, in-guest metrics, Application Insights, or a custom schedule
Most importantly, there are no additional expenses for the use of management and automation features for VMSS in Azure.
Automation and Actions
Azure autoscaling allows you to automate and scale your resources according to your needs.
With rules, you can trigger one or more actions, which include scaling resources in or out. This means you can adjust the amount of resources your application is using based on demand.
You can also trigger actions such as sending an email to the subscription admins, co-admins, and/or any other email address. This can be useful for notifications when scaling occurs.
Some common actions include scaling, email, and webhooks. Here are some examples of actions:
- Scale: Scale resources in or out.
- Email: Send an email to the subscription admins, co-admins, and/or any other email address.
- Webhooks: Call webhooks to trigger multiple complex actions inside or outside Azure.
Metrics-Based Scaling
Metrics-Based Scaling is a powerful tool in Azure that allows you to scale your resources based on specific metrics. This can be particularly useful for applications that experience high traffic during certain times of the day, week, or month.
You can configure Metrics-Based autoscaling rules to scale out your resources based on metrics like CPU, Memory, Thread Count, and more. For example, if you know that your application experiences high CPU usage during certain times, you can configure the rules to scale out additional instances to meet that demand.
Curious to learn more? Check out: Azure Monitor Metrics
There are two types of Metrics-Based autoscaling: CPU-intensive applications and caching servers. If you're running a CPU-intensive web application, you can use Metrics-Based autoscaling rules to scale out the stack during unexpected demands. Similarly, if you're running caching servers like Memcached or Redis, you can configure the rules based on memory utilization.
Here are some use cases for Metrics-Based autoscaling:
- Web servers that are CPU intensive
- Caching servers
- Application Servers
By using Metrics-Based autoscaling, you can ensure that your resources are scaled according to your application's needs, reducing the risk of downtime and improving overall performance.
Actions And Automation
Automation and actions are powerful tools that can help streamline your workflow and save you time. You can trigger actions with rules, which can include scaling resources in or out.
There are several types of actions you can automate, including sending emails to subscription admins, co-admins, and other email addresses.
You can also use webhooks to trigger complex actions inside or outside Azure. In Azure, webhooks can be used to call multiple actions.
Here are some examples of actions you can automate:
- Scale: Scale resources in or out.
- Email: Send an email to the subscription admins, co-admins, and/or any other email address.
- Webhooks: Call webhooks to trigger multiple complex actions inside or outside Azure.
Scale with Repeating Schedule

You can set your resource to scale to a specific instance count on a repeating schedule, which is useful for automating tasks that only need to run at certain times. For example, you can scale to 1 instance every Sunday.
To do this, select Add a scale condition, enter a description, and choose Scale to a specific instance count. Then, enter 1 in the Instance count field and select Repeat specific days. Choose Sunday and set the Start time and End time for when the scale condition should be applied.
Here's a step-by-step guide to setting up a scale condition with a repeating schedule:
1. Select Add a scale condition.
2. Enter a description for the scale condition.
3. Select Scale to a specific instance count.
4. Enter 1 in the Instance count field.
5. Select Repeat specific days.
6. Choose Sunday.
7. Set the Start time and End time for when the scale condition should be applied.
8. Select Save.
By following these steps, you can create a scale condition that reduces the number of instances of your resource to 1 every Sunday, which is perfect for tasks that only need to run on weekends.
You might like: When Did Azure Start
Advanced Features
Azure autoscaling offers advanced features that make it a powerful tool for managing your cloud resources. Time-Based autoscaling is one such feature that allows you to scale your resources based on the time of day.
You can use Time-Based autoscaling to launch development environments only during weekday business hours (9 AM – 5 PM) and automatically shut down instances when they're not needed. This is a great way to save costs and reduce waste.
With Time-Based autoscaling, you can also predict your application's demand based on its usage history and scale out the stack only during high-demand windows. This helps ensure that your application is always available and responsive when it's needed most.
Custom Metrics
Custom metrics are a powerful tool for scaling your applications. You can use your own custom metrics that your application generates to decide when to scale.
To get started, you'll need to configure your application to send metrics to Application Insights. This will allow you to use those metrics in your autoscale rules.
Some common metrics that you can use include CPU usage, memory usage, thread counts, queue length, and disk usage. For a more comprehensive list, check out the Autoscale Common Metrics page.
With custom metrics, you can create more tailored scaling rules that are specific to your application's needs. This can help you avoid over-scaling or under-scaling, and ensure that your application is running at optimal levels.
Here are some examples of how you can use custom metrics:
- Web servers that are CPU intensive can use CPU utilization metrics to scale out during unexpected demands.
- Caching servers like Memcached or Redis can use memory utilization metrics to scale out when memory is low.
- Application servers can use KPI metrics to scale out and scale in based on historical data.
Predictive Scaling
Predictive Scaling is a powerful feature that uses machine learning to help manage and scale virtual machine scale sets. It forecasts CPU load based on historical usage patterns.
This feature is especially helpful for managing cyclical workload patterns, which can be unpredictable and challenging to manage. It ensures that scaling occurs in time to meet demand.
By observing and learning from historical usage, Predictive Scaling can accurately predict CPU load and scale out virtual machine scale sets accordingly. This process helps prevent under or over-provisioning, which can lead to performance issues or wasted resources.
For example, Predictive Scaling can forecast CPU load for Azure Virtual Machine Scale Sets based on historical CPU usage patterns. This allows for proactive scaling and helps ensure that resources are allocated efficiently.
Time-Based Scaling Use Cases

Time-Based autoscaling can be incredibly useful in various scenarios, and I'd like to highlight two compelling use cases.
Development environments are often used only during weekday business hours, so scaling them up and down based on time can be a great way to save costs and resources.
You can predict and scale out production environments during high-demand windows, and scale in during low-demand periods, making the most of your resources.
Here are two specific use cases where Time-Based autoscaling can be particularly effective:
By implementing Time-Based autoscaling, you can ensure that your resources are always aligned with your business needs, resulting in significant cost savings and improved efficiency.
Prerequisites and Next Steps
Before you start using Azure Autoscaling, make sure you have a good understanding of Azure Monitor and Azure Resource Manager.
You'll also need to set up a resource group and a virtual machine scale set, which you can do using the Azure portal or Azure CLI.
To get the most out of Azure Autoscaling, it's a good idea to configure metrics and alerts for your virtual machine scale set.
This will help you monitor performance and make adjustments as needed.
Prerequisites

To set up autoscale for Azure Virtual Desktop, you need to ensure that your subscription and resource group are available and that the details in both the source and destination regions are identical.
You also need to make sure that Azure autoscale is available in the Azure region you want to move to. This is a crucial step, as autoscale won't work if it's not enabled in the destination region.
To use a power management scaling plan, you'll need to store your scaling plan configuration data in the same Azure region as your host pool configuration. This is a requirement, so make sure you follow this guideline.
You can deploy session hosts in any Azure region, but your scaling plan configuration data must be in the same region as the host pool configuration.
To use a dynamic scaling plan, you'll need to have a custom max session limit set for load balancing. This is different from the default value, so make sure you configure this setting correctly.
For your interest: Azure Data Studio Connect to Azure Sql

You'll also need to grant Azure Virtual Desktop access to manage the power state of your session hosts. This requires the Microsoft.Authorization/roleAssignments/write permission on your subscriptions.
Here are the key prerequisites for using autoscale with Azure Virtual Desktop:
- Ensure subscription and resource group availability
- Ensure Azure autoscale is available in the destination region
- Store scaling plan configuration data in the same region as host pool configuration
- Set custom max session limit for load balancing
- Grant Azure Virtual Desktop access to manage power state of session hosts
Next Steps
Now that you have the basics covered, it's time to take your autoscale engine to the next level.
First, create an activity log alert to monitor all autoscale engine operations on your subscription. This will keep you informed about any changes or issues that might arise.
To further refine your monitoring, create another activity log alert specifically for failed autoscale scale-in/scale-out operations on your subscription. This will help you catch any problems before they become major issues.
If you want to take notifications to the next level, use autoscale actions to send email and webhook alert notifications in Azure Monitor. This will ensure that you and your team are always in the loop.
If this caught your attention, see: Azure Problems
Azure Autoscaling Tools and Services
With Azure Virtual Machine Scale Sets, you get centralized control for automating the creation of virtual machines.
The process of creating and integrating with Azure load balancer or Application Gateway is automated, making it easier to manage multiple virtual machines.
Virtual machine instances can be automatically distributed across Availability Zones or Availability Sets for redundancy and high availability.
This means you can ensure your applications are always up and running, even in the event of a failure or maintenance.
Here are some of the advantages of using Azure Virtual Machine Scale Sets:
- Automated creation of virtual machines
- Automated integration with Azure load balancer or Application Gateway
- Automatic distribution across Availability Zones or Availability Sets
- Auto-scaling based on factors such as host metrics, in-guest metrics, Application Insights, or a custom schedule
And the best part? There are no additional expenses for using these management and automation features in Azure.
Frequently Asked Questions
What is the difference between autoscale and automatic scaling in Azure?
Autoscale and automatic scaling are two distinct features in Azure, with autoscale allowing you to define custom scaling rules based on schedules and resources, while automatic scaling is a scale-out option that handles scaling decisions for your web apps and App Service plans
Featured Images: pexels.com

