Categories
Azure Devops Scripts / Automation WVD

Azure Pipeline – Starting a Percentage of VMs in the HostPool At the Start of Business

Over the last few weeks, we have been extensively writing pipelines and codes for deployment of Windows Virtual Desktop for our customers.

One of the business requirement was to ensure that a pipeline runs everyday at around 7am to ensure that there is enough capacity of VMs during the start of business in cases where the LogicApp might have shut down the VMs because of them not being used during off business hours.

What does this Pipeline do?

  • From a given HostPool starts a percentage of Session hosts at a given time
  • Can be configured to run based on the time of your choice
  • Runs as an Azure Pipeline, maybe converted as Azure Automation runbook if you desire.
  • Works on a per HostPool basis, extend it to any HostPool in your WVD infrastructure

Pre-Requisites:

  • Azure Devops Project setup with Service Connections
  • Some knowledge on Pipeline triggers
  • Azure Github Repository / Azure Devops repository (you may use this code anywhere as per your choice.
  • An existing WVD HostPool

Variables to update in the pipeline for use:

  • $resourcegroup = “<Enter the Name of your resource group>”
  • $HostPoolName = “<Enter the name of your Hostpool>”
  • $requiredmachinesPercentage = <Percentage of VMs to be started at the start of business example: 50>
  • $DomainName = “<Enter your domain name>”

Pipeline Link: GitHub-Repo

Other references:
If you are unsure how to build a pipeline? This Link should help
If you would like to know about Azure LogicApp for WVD scaling This Link should help

One reply on “Azure Pipeline – Starting a Percentage of VMs in the HostPool At the Start of Business”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s