1. Home
  2. Training Library
  3. Microsoft Azure
  4. Courses
  5. Automating Azure Virtual Desktop Management Tasks

Implementing Autoscaling in Host Pools

Start course

An important aspect of any Azure Virtual Desktop (AVD) environment is ensuring you automate management of the environment where you can. To get the most out of this cloud-hosted service, it is important to ensure you are utilizing automation to limit the amount of time spent doing manual tasks. This will give a much better experience for your users and administrators. From an automation perspective, you can utilize Azure native services to facilitate automating daily management tasks which will minimize manual intervention by admins.

This course will help you plan and automate management tasks for your Azure Virtual Desktop and help you understand how it integrates with other Azure native automation services.

Learning Objectives

  • Configure automation for Azure Virtual Desktop
  • Automate management of host pools, session hosts, and user sessions by using PowerShell and Azure Command Line Interface (CLI)
  • Implement autoscaling in host pools

Intended Audience

This course is intended for anyone who wants to become an Azure Virtual Desktop Specialist and/or those preparing to take the AZ-140 exam. 


If you wish to get the most out of this course, it is recommended that you have a good understanding of Azure administration, although it's not essential.


Welcome to this module on implementing autoscaling in host pools. In this module we will cover the following topics:

  • Azure Virtual Desktop Scaling plans
  • Requirements for auto-scaling in AVD
  • A demo where I will configure an auto-scaling plan for Azure Virtual Desktop

Let’s start off by discussing scaling plans.  Traditionally, scaling was implemented within Azure using either Powershell scripts or Azure Automation, however, you can utilize a feature called scaling plans.

Scaling plans allows you to define ramp-up hours which is the time you want to increase resources when the usage increases.  

Peak hours which is the time of day when usage is at its highest.

Ramp-down hours when usage starts to drop off.

You can then configure associated triggers which will kick off your scaling plan if those triggers are met, for example, a certain percentage of CPU usage.  Finally, your scaling plan must include an associated schedule for at least one day of the week.

Let’s now move on to discussing requirements for autoscaling in Azure Virtual Desktop.  There are two main items that need to be in place before you can start implementing autoscaling.  The first is that you need to create a custom role-based access control, better known as RBAC, role.  Once this role has been created, the second item that needs to be in place is that you need to assign this role to the Azure Virtual Desktop application.  

Once these two requirements are fulfilled, you can start configuring autoscaling in Azure Virtual Desktop

To finish off this module we are going to complete a demo of implementing a scaling plan in Azure that you can utilize with your AVD environment

Here we are in the Azure Portal.  We need to navigate to the scaling plans section of the portal. We do not currently have any existing scaling plans, so let’s select ‘Create’.  We now need to ensure we select the relevant subscription, resource group and give the scaling plan a name. You will need to be careful when selecting the location as not all locations support scaling plans.  In our example, I am selecting Canada East as I know this region is supported.  Finally, I am giving it a friendly name and moving on to the schedule plan.

We need to select ‘Add schedule’.  We now have a number of different panes we need to complete.  First, let’s enter general information like the schedule name.  We then need to select which days we want the schedule to repeat on, in our case, we select each weekday.

For ‘ramp-up’ hours, the repeat on days and time zone are already entered by default, so we need to enter the start time.  Please note this utilizes the 24-hour clock system.  We then need to specify the load balancing algorithm.  I am going to leave this on bread-first.  We then need to specify the minimum percentage of session host virtual machines to start for ramp-up and peak hours.  I will leave this on the default of 20%.  Finally, on this pane, we need to enter the percentage of used host pool capacity that will be considered to evaluate whether to turn on or off virtual machines during ramp-up and peak hours.

If we now move onto the ‘Peak Hours’ pane, again the days and time zone are already selected and we need to specify the start time and load balancing algorithm which I am going to change to bread-first.  The threshold capacity is grayed out and set to 60%, therefore we cannot edit this.

Now we move on to the ‘ramp-down’ pane.  The first value we need to set is the start time, then the load balancing algorithm, which I am again going to set as breadth-first.  We now need to set the minimum percentage of session host virtual machines that you would like to get to for ramp-down and off-peak hours.

Next, we need to select the percentage of used host pool capacity that will be considered to evaluate whether to turn on or off virtual machines during ramp-down and off-peak hours.  We can then specify if we want to force users to log off or not, set a delay time before forcing the users to log off and customize a notification message.

The final pane to complete the schedule configuration is the ‘off-peak hours’ pane.  Here we need to specify the start time, and load balancing algorithm.  Again I am changing this to bread-first.  Please note we cannot edit the capacity threshold again.

Now the schedule is configured we need to select the host pool we want this to apply to.  In our case, we do not have an active host pool in this tenant. Finally, we can enter any tags we want to set, before reviewing and creating our scaling plan.

About the Author

Shabaz Darr is a Senior Infrastructure Specialist at Netcompany based in the UK. He has 15 years plus experience working in the IT industry, 7 of those he has spent working with Microsoft Cloud Technologies in general, with a focus on MEM and IaaS. Shabaz is a Microsoft MVP in Enterprise Mobility with certifications in Azure Administration and Azure Virtual Desktop. During his time working with Microsoft Cloud, Shabaz has helped multiple public and private sector clients in the UK with designing and implementing secure Azure Virtual Desktop environments.