Description
UiPath.AzureWindowsVirtualDesktop.Activities package offers activities for Azure Windows Virtual Desktop (WVD). WVD is a desktop and app virtualization service that runs on Azure cloud.
This set of activities enables IT Departments to easily automate processes related to provisioning and managing of virtual desktops in Azure. These activities can be used to automate tasks like:
- On-boarding - provision a virtual desktop for a new employee.
- Off-boarding - remove a virtual desktop when an employee leaves the company.
- Manage host pools, session hosts, user sessions, application groups:
- Create a host pool and add existing virtual machines to it.
- Update or delete a host pool.
- Assign users and groups to an application group.
- Remove users and groups from an application group.
- Update or delete a session host.
- Disconnect or delete (log off) a user session.
- Send a message to a user session.
Activities list
Windows Virtual Desktop Scope – Connects to Azure Windows Virtual Desktop and provides a scope for other Windows Virtual Desktop activities.
Host Pools activities
Create Host Pool – Creates a new host pool. A default desktop application group is created by the activity.
Add Virtual Machine to Host Pool – Adds an existing Azure virtual machine to the specified host pool.
Get Host Pool – Gets details about a host pool.
For Each Host Pool – Performs an activity or a series of activities on each host pool in the current subscription.
Update Host Pool – Updates a host pool.
Delete Host Pool – Deletes a host pool.
Session Hosts activities
Get Session Host – Gets details about a session host within the specified host pool.
For Each Session Host – Performs an activity or a series of activities on each session host within the specified host pool.
Update Session Host – Updates a session host.
Delete Session Host – Deletes a session host.
User Sessions activities
For Each User Session – Performs an activity or a series of activities on each user session within a specified session host.
Disconnect User Session – Disconnects a user session.
Delete User Session – Deletes (logs off) a user session.
Send Message to User Session – Sends a message to a user session.
Application Groups activities
Get Application Group – Gets details about an application group.
For Each Application Group – Performs an activity or a series of activities on each application group, in the current subscription, that matches the filter criteria.
Assign Users and Groups to Application Group – Assigns users and groups to an application group.
Remove Users and Groups from Application Group – Removes users and groups from an application group.
How to install
UiPath.AzureWindowsVirtualDesktop.Activities package is available in preview on the Official feed, as a prerelease. In the Official feed, check ‘Include Prerelease’, search for “UiPath.AzureWindowsVirtualDesktop.Activities” and install it.
Important - We must reiterate, make sure you check the ‘Include Prerelease’ checkbox
Azure WVD activities should be visible now in UiPath Studio, as shown below:
How to use: Create a New Personal Virtual Desktop for a User
This sample UiPath Studio project shows how to use Azure WVD activities to automate the creation of a new virtual desktop for a specific user. The workflow consists of the following actions:
- Connect to Azure.
- Create a new ‘Personal’ host pool.
- Assign the user account to the default desktop application group of the host pool.
- Create a new session host by adding an existing Virtual Machine (VM) to the host pool.
- Assign the user to the session host.
- Send an email to the user with details about how to access her/his virtual desktop.
The UiPath Studio project: Azure_WVD_sample.zip (4.5 KB)
Let us go step by step through the process of creating the workflow:
-
Connect to Azure. Add Windows Virtual Desktop Scope activity to connect to Azure and provide a scope for Azure WVD activities. Set a value for ClientID, ClientSecret (secure string), SubscriptionID, TenantID and Environment parameters.
-
Create a new ‘Personal’ host pool. Add Create Host Pool activity to create a host pool of type ‘Personal’. In case of personal desktop each user is allocated a desktop. This activity creates a default desktop application group.
- Select Type = Personal and PersonalDesktopAssignmentType = Direct. With direct assignment, I must later assign the user to both the host pool’s desktop application group and to a specific session host before s/he can connect to the personal desktop.
- Set a value for mandatory parameters Name, ResourceGroupName and Region.
- I also recommend setting a value for the Workspace parameter so the host pool’s default desktop application group will be registered with the specified workspace. A desktop application group must be associated with a workspace for users to see the desktops published to them.
- Optionally, provide a value for FriendlyName, Description and Tags parameters.
-
Assign the user to the default desktop application group of the newly created host pool.
-
First, add Get Application Group activity to retrieve the WVDApplicationGroup object associated with the host pool’s default desktop application group. Pass hostPoolInfo.DefaultDesktopApplicationGroupName and hostPoolInfo.ResourceGroupName values to the mandatory parameters.
-
Then, assign the user to the desktop application group by using Assign Users and Groups to Application Group activity. Specify the user by setting UsersAndGroupsIds to {“user-object-id”}, where user-object-id represents the Object ID of the user account in Azure AD. This value can be obtained from Azure portal or using Get User activity of UiPath.AzureActiveDirectory.Activities package.
To use this activity, the client (application) specified in Windows Virtual Desktop Scope activity (ClientID property) should have the permissions described here: Assign Azure roles using the REST API - Azure RBAC | Microsoft Learn. For example, you can assign ‘Owner’ role to your client (application) for the resource group to which the application group belongs by following the steps described here: Assign Azure roles using the Azure portal - Azure RBAC | Microsoft Learn.
-
-
Create a new session host by adding an existing Virtual Machine (VM) to the host pool. Now let’s add a VM to the host pool using Add Virtual Machine to Host Pool activity. The VM can be created in Azure portal or using Create VM activity of UiPath.Azure.Activities package.
- Specify the Azure VM by setting a value for the parameters in Virtual Machine category – Name and ResourceGroupName. As prerequisite, the VM’s status should be ‘Running’ when using this activity.
- Specify the credentials of a domain user account that will be used to join the VM to the domain. If DomainToJoin is not set, the VM will be joined to the domain matching the suffix of the user principal name provided in DomainUsername parameter.
- This activity takes a long time, so it is recommended to set a Timeout of 1200 or longer to be sure it will complete (in case you want to wait for completion to perform other operations on the resulted session host).
-
Assign the user to the session host. Once the session host has been created, we need to assign the user to the session host with Update Session Host activity. This step is required only when the host pool to which the session host belongs has direct assignment option enabled.
-
Send an email to the user with details about how to access her/his virtual desktop. Finally, let’s inform the user about the new personal virtual desktop by sending a nice email with Send Outlook Mail Message activity. This email will contain information about how to access the desktop.
That’s all folks ! Take a look at these activities that will help automate your Azure WVD tasks.
Please give us feedback and suggest improvements .