How do I remove a sesion host from a AVD hostpool using the cli

Greg Bonk 86 Reputation points
2022-10-17T21:35:07.613+00:00

Using only the Azure CLI I would like to remove a session host registration that is registered with a host pool in Azure Virtual Desktop

I've been round and round with the CLI docs and I can't find anything for unregister a session host.

There does appear to be a powershell way, but I am restricted to using the CLI.

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

Accepted answer
  1. KarishmaTiwari-MSFT 20,772 Reputation points Microsoft Employee Moderator
    2022-10-21T04:59:32.753+00:00

    @Greg Bonk
    Currently, the session host object is not listed in the AZ CLI reference : az desktopvirtualization | Microsoft Learn
    Thus, it is not supported to remove a session host using Azure CLI.

    However, an alternative is to use REST API instead to delete the session host as described here:

    Session Hosts - Delete - REST API (Azure Desktop Virtualization) | Microsoft Learn

    Your feedback is valuable and we would request you to share your feedback by clicking on Feedback option at the bottom of this document so that it can reach the right team and they can prioritize it.

    252768-image.png

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Greg Bonk 86 Reputation points
    2022-10-20T15:41:11.553+00:00

    Thank you for the details. Hopefully they will get the CLI updated.

    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.