🔒 Guided

Pre-launch preview. Authorised access only.

Incorrect code

Guided by A Guide to Cloud
Explore AB-900 AI-901
Guided AZ-140 Domain 1
Domain 1 — Module 9 of 12 75%
9 of 28 overall

AZ-140 Study Guide

Domain 1: Plan and Implement an AVD Infrastructure

  • AVD Architecture: The Big Picture Free
  • Network Capacity and Design Free
  • RDP Shortpath, Multipath and QoS Free
  • Private Link and Network Troubleshooting Free
  • Storage Planning for User Data Free
  • File Shares and Azure NetApp Files Free
  • Host Pool Architecture: Personal vs Pooled Free
  • Sizing for Performance and Capacity Free
  • Creating Host Pools and Session Hosts Free
  • Session Host Licensing Free
  • Building Session Host Images Free
  • Image Lifecycle and Compute Gallery Free

Domain 2: Plan and Implement Identity and Security

  • Identity Scenarios for AVD
  • RBAC, Conditional Access and SSO
  • Defending AVD with Microsoft Defender
  • Network Security: NSGs, Firewall, Bastion
  • Threat Protection and Confidential VMs

Domain 3: Plan and Implement User Environments and Apps

  • FSLogix Profile Containers and ODFC
  • FSLogix Cloud Cache and Application Masking
  • AVD Clients: Choose and Deploy
  • User Experience and Session Settings
  • Application Groups and RemoteApp
  • Microsoft 365, Teams and OneDrive on AVD
  • App Attach: Dynamic Application Delivery

Domain 4: Monitor and Maintain an AVD Infrastructure

  • Monitoring AVD with Azure Monitor
  • Autoscaling and Session Management
  • Update Strategy and Backups
  • Disaster Recovery and Multi-Region

AZ-140 Study Guide

Domain 1: Plan and Implement an AVD Infrastructure

  • AVD Architecture: The Big Picture Free
  • Network Capacity and Design Free
  • RDP Shortpath, Multipath and QoS Free
  • Private Link and Network Troubleshooting Free
  • Storage Planning for User Data Free
  • File Shares and Azure NetApp Files Free
  • Host Pool Architecture: Personal vs Pooled Free
  • Sizing for Performance and Capacity Free
  • Creating Host Pools and Session Hosts Free
  • Session Host Licensing Free
  • Building Session Host Images Free
  • Image Lifecycle and Compute Gallery Free

Domain 2: Plan and Implement Identity and Security

  • Identity Scenarios for AVD
  • RBAC, Conditional Access and SSO
  • Defending AVD with Microsoft Defender
  • Network Security: NSGs, Firewall, Bastion
  • Threat Protection and Confidential VMs

Domain 3: Plan and Implement User Environments and Apps

  • FSLogix Profile Containers and ODFC
  • FSLogix Cloud Cache and Application Masking
  • AVD Clients: Choose and Deploy
  • User Experience and Session Settings
  • Application Groups and RemoteApp
  • Microsoft 365, Teams and OneDrive on AVD
  • App Attach: Dynamic Application Delivery

Domain 4: Monitor and Maintain an AVD Infrastructure

  • Monitoring AVD with Azure Monitor
  • Autoscaling and Session Management
  • Update Strategy and Backups
  • Disaster Recovery and Multi-Region
Domain 1: Plan and Implement an AVD Infrastructure Free ⏱ ~14 min read

Creating Host Pools and Session Hosts

Learn how to create host pools and session hosts using the Azure portal, PowerShell, Azure CLI, ARM templates, and Bicep — from manual setup to full automation.

Creating your first host pool

☕ Simple explanation

Think of a host pool like a car rental depot.

The depot (host pool) holds a fleet of cars (session host VMs). Customers (users) walk in, show their ID (authenticate), and get assigned an available car. You decide how many cars to stock, what model they are, and the rules — like “max 10 rentals per car” (session limit) or “spread customers across all cars evenly” (load balancing).

Before a car can join the fleet, it needs a special sticker (registration token) that proves it belongs to this depot. That sticker expires after a set time, so you generate a new one whenever you add cars.

A host pool is a collection of Azure VMs (session hosts) registered to Azure Virtual Desktop. When users connect, the AVD broker assigns them to an available session host in the pool.

Creating a host pool involves two steps: (1) create the host pool resource itself (settings, load balancing, registration token), and (2) deploy and register session host VMs to that pool. You can do both through the Azure portal in a single wizard, or separate them when automating with PowerShell, CLI, or infrastructure-as-code.

Key decisions at creation time include pool type (personal or pooled), load balancing algorithm, max session limit, validation environment flag, and domain join method (Entra ID join, hybrid join, or AD DS join).

Creating a host pool via the Azure portal

The portal wizard walks you through every setting. Here is the flow step by step:

Step 1 — Basics

SettingWhat to chooseWhy it matters
Host pool typePooled or PersonalPooled shares VMs across users. Personal assigns one VM per user.
Load balancingBreadth-first or Depth-firstBreadth-first spreads users evenly. Depth-first fills one VM before moving to the next.
Max session limitA number (e.g. 10)How many users can log in to a single session host at the same time. Only applies to pooled.
Validation environmentYes or No”Yes” means this pool receives AVD service updates first — use for testing, not production.

🎧 Mia’s scenario: “When Horizons Health opened a new clinic in Hamilton, I needed a quick host pool for 20 nurses. I used the portal — picked pooled, breadth-first, max 8 sessions per host, and had them connected within the hour.”

Step 2 — Virtual Machines

You configure the session hosts that will be deployed into the pool:

  • Image: Choose a marketplace image (Windows 11 Enterprise multi-session with M365 Apps) or a custom image from an Azure Compute Gallery.
  • VM size: Pick a size that matches the workload (e.g. D4s_v5 for general office, NV-series for GPU).
  • Number of VMs: How many session hosts to deploy now.
  • Name prefix: All VMs will be named with this prefix plus a number (e.g. avd-pool01-0, avd-pool01-1).
  • Domain join: Choose Microsoft Entra ID join, hybrid Entra join, or Active Directory Domain Services.
  • Virtual network and subnet: The network where session hosts will live.

Step 3 — Workspace

You can associate an application group (the default Desktop Application Group) with a workspace so users see their desktops in the feed. You can do this later too.

Step 4 — Review and create

Azure deploys the host pool resource, creates the VMs, installs the AVD agent, and registers them using a registration token — all automatically.

💡 Exam tip: Registration tokens

A registration token is a time-limited key that authorises a VM to join a host pool. Tokens expire after the time you set (max 27 days, default 24 hours in scripted scenarios). If a token expires, session hosts created with it won’t register — you need to generate a new token. The exam tests whether you understand that tokens are required for registration and that they expire.

How session host registration works

When a VM registers to a host pool, here is what happens behind the scenes:

  1. The AVD Agent is installed on the VM (the portal does this automatically; manual installs use an MSI).
  2. The agent reads the registration token and contacts the AVD service.
  3. AVD verifies the token is valid and not expired.
  4. The session host appears in the host pool with status Unavailable initially.
  5. The Agent Boot Loader starts, and the status changes to Available.
  6. The token value is cleared from the registry — the VM uses a machine token going forward.

If registration fails, check Event Viewer under Windows Logs and Application for event ID 3277 with messages like INVALID_REGISTRATION_TOKEN or EXPIRED_MACHINE_TOKEN.

Automating host pool creation

The portal is great for learning, but production environments demand automation. Here are your options.

PowerShell

Use the Az.DesktopVirtualization module:

# Create the host pool
New-AzWvdHostPool -ResourceGroupName "rg-avd-prod" `
  -Name "hp-pooled-prod" `
  -Location "australiaeast" `
  -HostPoolType "Pooled" `
  -LoadBalancerType "BreadthFirst" `
  -MaxSessionLimit 12 `
  -PreferredAppGroupType "Desktop"

# Generate a registration token (valid 24 hours)
New-AzWvdRegistrationInfo -ResourceGroupName "rg-avd-prod" `
  -HostPoolName "hp-pooled-prod" `
  -ExpirationTime $((Get-Date).ToUniversalTime().AddHours(24).ToString('yyyy-MM-ddTHH:mm:ss.fffffffZ'))

You then deploy VMs separately (using New-AzVM or ARM templates) and install the AVD agent with the registration token.

Azure CLI

# Create the host pool
az desktopvirtualization hostpool create \
  --resource-group rg-avd-prod \
  --name hp-pooled-prod \
  --location australiaeast \
  --host-pool-type Pooled \
  --load-balancer-type BreadthFirst \
  --max-session-limit 12 \
  --preferred-app-group-type Desktop

# Generate a registration token
az desktopvirtualization hostpool update \
  --resource-group rg-avd-prod \
  --name hp-pooled-prod \
  --registration-info expiration-time="2025-12-31T23:59:59Z" \
    registration-token-operation="Update"

ARM templates and Bicep

For repeatable infrastructure-as-code, use the Microsoft.DesktopVirtualization/hostPools resource type. Here is a simplified Bicep example:

resource hostPool 'Microsoft.DesktopVirtualization/hostPools@2024-04-03' = {
  name: 'hp-pooled-prod'
  location: 'australiaeast'
  properties: {
    hostPoolType: 'Pooled'
    loadBalancerType: 'BreadthFirst'
    maxSessionLimit: 12
    preferredAppGroupType: 'Desktop'
    validationEnvironment: false
  }
}

The session host VMs are separate Microsoft.Compute/virtualMachines resources with a VM extension that installs the AVD agent and passes the registration token.

🏢 Raj’s approach: “At TerraStack, we manage 8,000 desktops — there is no way I am clicking through the portal for each pool. We have a Bicep module that creates host pools, deploys session hosts from our golden image, and registers them. One pipeline, consistent every time.”

Portal vs PowerShell vs ARM/Bicep vs CLI
AspectAzure PortalPowerShellARM / BicepAzure CLI
Best forLearning, small deployments, quick one-offsScripted automation, ad-hoc tasksRepeatable IaC, CI/CD pipelinesCross-platform scripting, quick automation
RepeatabilityLow — manual clicks each timeMedium — scripts can be reusedHigh — declarative, version-controlledMedium — scripts can be reused
IdempotentN/APartially (depends on script logic)Yes — ARM/Bicep deploys desired statePartially (depends on script logic)
Learning curveEasiestModerate (PowerShell knowledge)Steeper (template syntax)Moderate (CLI knowledge)
IntegrationNone (manual)Azure Automation, pipelinesGitHub Actions, Azure DevOpsGitHub Actions, Azure DevOps
Exam relevanceKnow the wizard stepsKnow key cmdletsKnow resource typesKnow key commands
ℹ️ When to use portal vs automation

Use the portal when you are learning, prototyping, or deploying a handful of session hosts. Use automation (PowerShell, CLI, ARM/Bicep) for production environments, multi-pool deployments, disaster recovery, and anything you need to repeat. A good rule of thumb: if you will do it more than once, automate it.

Configuring host pool RDP properties

RDP properties control what devices and resources are redirected between the user’s local device and their AVD session. You configure these on the host pool, and they apply to all session hosts.

Common RDP properties include:

PropertyWhat it controlsExample value
Clipboard redirectionCopy/paste between local and remoteredirectclipboard:i:1 (enabled)
Drive redirectionAccess local drives in the sessiondrivestoredirect:s:* (all drives)
Printer redirectionUse local printers from the sessionredirectprinters:i:1 (enabled)
Audio redirectionWhere audio playsaudiomode:i:0 (play on local device)
Camera redirectionUse local webcam in the sessioncamerastoredirect:s:* (all cameras)

You set these in the Azure portal under Host pool then RDP Properties, or via PowerShell:

Update-AzWvdHostPool -ResourceGroupName "rg-avd-prod" `
  -Name "hp-pooled-prod" `
  -CustomRdpProperty "redirectclipboard:i:0;drivestoredirect:s:;redirectprinters:i:0"

🏛️ JC’s scenario: “At the Federal Department, Aisha (our security auditor) required clipboard and drive redirection disabled. No data leaves the session. We set those RDP properties on the host pool and every session host enforces it.”

💡 Exam tip: RDP properties and security

The exam often tests scenarios where security requirements dictate which RDP properties to enable or disable. If a question mentions “prevent data exfiltration” or “restrict file copy,” think about disabling clipboard and drive redirection. You can also enforce these through Conditional Access and Intune, but RDP properties on the host pool are the AVD-native approach.

Drain mode — graceful maintenance

When you need to patch, restart, or replace a session host, you don’t want to kick users off mid-work. Drain mode solves this:

  1. Set the session host to drain mode (Allow new sessions = No).
  2. The broker stops sending new users to that host.
  3. Existing sessions continue until users log off naturally.
  4. Once empty, perform your maintenance.

You can set drain mode in the portal (Session hosts tab, toggle Allow new sessions) or via PowerShell:

Update-AzWvdSessionHost -ResourceGroupName "rg-avd-prod" `
  -HostPoolName "hp-pooled-prod" `
  -Name "avd-pool01-0.contoso.com" `
  -AllowNewSession:$false

🎧 Mia’s tip: “I always drain session hosts before updating them. Tom on night shift can finish his charting without being disconnected. Once the host is empty, I swap it out with a fresh VM from the latest image.”

Question

What is a registration token in AVD?

Click or press Enter to reveal answer

Answer

A time-limited key that authorises a VM to register as a session host in a specific host pool. Tokens have a maximum lifetime of 27 days. Once the VM registers, the token is cleared and a machine token is used instead.

Click to flip back

Question

What PowerShell cmdlet creates a new host pool?

Click or press Enter to reveal answer

Answer

New-AzWvdHostPool from the Az.DesktopVirtualization module. Key parameters include -HostPoolType, -LoadBalancerType, and -MaxSessionLimit.

Click to flip back

Question

What does drain mode do on a session host?

Click or press Enter to reveal answer

Answer

Drain mode prevents new user sessions from being assigned to that session host. Existing sessions continue until users log off. This allows graceful maintenance without disrupting active users.

Click to flip back

Question

What is the Bicep resource type for a host pool?

Click or press Enter to reveal answer

Answer

Microsoft.DesktopVirtualization/hostPools — it is a top-level ARM resource. Session host VMs are separate Microsoft.Compute/virtualMachines resources that register via the AVD agent and a registration token.

Click to flip back

Knowledge Check

Mia needs to create a host pool for a new clinic with 20 nurses. She wants the quickest setup with minimal scripting. Which approach should she use?

Knowledge Check

Raj needs to prevent data exfiltration from AVD sessions at TerraStack. Which settings should he configure on the host pool?

Knowledge Check

A session host fails to register to a host pool. Event ID 3277 shows EXPIRED_MACHINE_TOKEN. What should you do first?

🎬 Video coming soon

Creating Host Pools and Session Hosts


Next up: Session Host Licensing — understand which licenses your users need for AVD, the difference between Windows client and Windows Server licensing, and how Azure Hybrid Benefit saves money.

← Previous

Sizing for Performance and Capacity

Next →

Session Host Licensing

Guided

I learn, I simplify, I share.

A Guide to Cloud YouTube Feedback

© 2026 Sutheesh. All rights reserved.

Guided is an independent study resource and is not affiliated with, endorsed by, or officially connected to Microsoft. Microsoft, Azure, and related trademarks are property of Microsoft Corporation. Always verify information against Microsoft Learn.