How to change an application group's host pool?

Don Langham 0 Reputation points
2024-09-26T10:29:13.5466667+00:00

In AVD I have multiple host pools. I have an application group that uses hostpool1. I want the applications to use hostpool2 instead of hostpool1.

I don't see any way of changing the application group's host pool in the Azure portal. Am I missing it?

If not, then how to do this using the Azure PowerShell Module? It looks like the Set-RdsAppGroup command would do this. Is that the correct approach?

Azure Virtual Desktop
Azure Virtual Desktop
A Microsoft desktop and app virtualization service that runs on Azure. Previously known as Windows Virtual Desktop.
1,835 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Prrudram-MSFT 28,201 Reputation points Moderator
    2024-09-26T14:02:13.45+00:00

    Hello @Don Langham

    You're correct that the Azure portal doesn't provide a direct option to change the host pool for an existing application group1. However, I believe you can achieve this using the Azure PowerShell.

    Let me give you step-by-step details with the AzWvd cmdlets. Here's how you should be able to change the application group's host pool using Azure PowerShell:

    Step 1: Install and Import the Az.DesktopVirtualization Module

    Make sure you have the Az.DesktopVirtualization module installed. If not, you can install it using the following command:

    powershellCopy

    Install-Module -Name Az.DesktopVirtualization -AllowClobber -Force
    

    Import the module:

    powershellCopy

    Import-Module Az.DesktopVirtualization
    

    Step 2: Connect to Your Azure Account

    powershellCopy

    Connect-AzAccount
    

    Step 3: Get the Existing Application Group

    Retrieve the details of your existing application group.

    powershellCopy

    $resourceGroupName = "your-resource-group-name"
    $applicationGroupName = "your-application-group-name"
    $appGroup = Get-AzWvdApplicationGroup -ResourceGroupName $resourceGroupName -Name $applicationGroupName
    

    Step 4: Unregister the Application Group from the Current Host Pool

    First, remove the existing association.

    powershellCopy

    $hostPoolName = "current-hostpool-name"
    Unregister-AzWvdApplicationGroup -ResourceGroupName $resourceGroupName -HostPoolName $hostPoolName -Name $applicationGroupName
    

    Step 5: Register the Application Group to the New Host Pool

    Now, register the application group to the new host pool.

    powershellCopy

    $newHostPoolName = "new-hostpool-name"
    Register-AzWvdApplicationGroup -ResourceGroupName $resourceGroupName -HostPoolName $newHostPoolName -Name $applicationGroupName
    

    Step 6: Verify the Update

    Check that the application group is now associated with the new host pool.

    powershellCopy

    Get-AzWvdApplicationGroup -ResourceGroupName $resourceGroupName -Name $applicationGroupName
    

    These commands should help you reassign your application group to a different host pool using the latest Azure PowerShell cmdlets.
    Reference: https://learn.microsoft.com/en-us/powershell/module/az.desktopvirtualization/get-azwvdapplication?view=azps-12.3.0

    If it doesn't resolve your issue, please tag me in your comments and I will be happy to help you further.

    If this answer resolves your query, please click "Accept as answer" as a token of appreciation**


  2. Prrudram-MSFT 28,201 Reputation points Moderator
    2024-10-14T19:15:03.3766667+00:00

    Hello @Don Langham
    Apologies for the confusion.
    I have checked with internal AVD product team, and they have confirmed that it is not possible. You cannot disassociate an Application Group from a hostpool and associate it to a different hostpool. You will have to create a new AppGroup with same config on the other Host Pool. Application Groups are not a type of object that can be roamed across different HPs.

    I would recommend marking this as answer by Accept Answer as it will help other customer looking for answer to this scenario. As this is not documented elsewhere, this question from you serves as a knowledge base. As an original poster, only you can accept an answer on this question.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.