Tutorial: Prepare LoadGen for testing or monitoring Azure Virtual Desktop

Please note

The LoadGen test infrastructure (LoadGen Director, LoadGen Launcher Agents, and the LoadGen AVD Agents) all communicate with each other (read more about network traffic here). You must either add the LoadGen Director and LoadGen Launcher Agents in Azure as Virtual Machines or make sure you make a Site-to-Site VPN between your Azure WVD VNET and the network on which your LoadGen Director and LoadGen Launcher Agents reside.

Windows Virtual Desktop (WVD) is renamed to Azure Virtual Desktop (AVD)

But not everything is yet renamed, so in some cases, we still use WVD instead of AVD.

Step 1: Download and install prerequisites

  1. Click the Download & Install button
  2. Make sure you have the VC Runtime libraries installed.
  3. Make sure you have read and understood the System Requirements of LoadGen.
  4. Make sure you have a SQL Database available if you want to try LoadGen you can also choose to install SQL Express for the time being.

Step 2: Choose your Target Environment

LoadGen 2021-Q1 - 5.0.0.6800

Starting from LoadGen Release 2021-Q1 we support Azure Virtual Desktop. If you want to continue stop the LoadGen Configurator and start the LoadGen Director.

  1. Close the LoadGen Configurator.
  2. Go to the Windows Start Menu.
  3. Open the LoadGen Director.

Step 3: Create an Azure Active Directory App Registration

First, you must create an Azure AD App Registration. This is necessary as we need to get access to the Azure Virtual Desktop resources of a test user.

Go to https://portal.azure.com and log on with a user with the appropriate rights to create an App Registration.
  1. Click on the Azure Active Directory button Azure Active Directory
  2. Go to the App Registrations option App Registrations
  3. Click New Registration  New App Registration
  4. Add the name of your App registration and press Register.


  5. Now the new App is registered, here you can find the Application (Client) Id and the Directory (Tenant) Id. These two GUIDs you will need later on configuring the Load Profile in the LoadGen Director.
  6. Now click on the Authentication option and set the Allow public client flows to Yes.

Azure Virtual Desktop - spring 2020 (ARM)

  1. Go to API permissions, and click Add Permission. Click the APIs my organization uses and search for Azure or Windows Virtual Desktop. Choose the Azure Virtual Desktop or Windows Virtual Desktop. The Application (client) ID will start with 9cdea.
  2. Choose the Delegated permissions tab and select the User.Access API.
  3. Click Add permissions.
  4. Now remove the default Microsoft Graph User.Read API Permission.
  5. If the User.Read is removed you only have the User.Access remaining.
  6. Now grant consent by clicking

Azure Virtual Desktop - Classic

  1. Go to API permissions, and click the Add Permission. Click the APIs my organization uses and search for Windows Virtual Desktop. Choose the Windows Virtual Desktop AME.


  2. Choose the Delegated permissions tab and select the user_impersonation API.
  3. Click Add permissions.
  4. Now remove the default Microsoft Graph User.Read API Permission.
  5. If the User.Read is removed you only have the user_impersonation remaining.
  6. Now grant consent by clicking

Step 4: Prepare LoadGen Agents

As the Azure Virtual Desktop relies heavily on the new Azure AD login experience we need to prepare the LoadGen Agents. The LoadGen Agent will launch the different sessions to the Azure Virtual Desktop environment. There are some considerations:
  1. You can host your LoadGen Agents on-premises or in another environment. Make sure you have a direct connection to the Network of the Azure Virtual Desktop environment. Also, the following ports must be opened on the Firewall or NSG, read more in this article.
  2. The LoadGen Agents must be plenty sized, as the (new) Remote Desktop client is using a lot of resources (msrdc.exe).
  3. Install the Microsoft Remote Desktop client (download) on the LoadGen Agents, as mentioned earlier the LoadGen Agents will launch the Azure Virtual Desktop sessions via the msrdc.exe application. 
When you have decided where to install the LoadGen Agents make sure the LoadGen Director has been started, and first create a new Canvas.

 

  1. Create a LoadGen Director Canvas LoadGen Add a new Load Profile
  2. Choose FAT Client (Windows 7 and up)  
  3. Add a name, please note this is not your actual AVDtest profile, this is something we will do after the preparation of the LoadGen Agents.
  4. Now click on the Flows tab and choose Link to existing...
  5. Download this LoadGen Flow and use this Flow (this flow only works on English versions of Windows -> you can change the flow if you have another OS language installed). Download the Flow here. Read more about this Flow / Workload in this article.
  6. Now click the Test machines and add the LoadGen Agents which you want to use in your Azure Virtual Desktop later on. Read more about how to install LoadGen Agents in this article.
  7. Now click the Load Scenario tab, click the Manage button, and alter your Load Scenario or Schedule. Close the window and choose the Default Load Scenario.
  8. Click OK to save the canvas.
  9. Load the newly created canvas.
  10. Now open the canvas by double-clicking the Flow icon in the canvas.

Step 5: Prepare LoadGen Agents AVD user tokens

We have now set up our LoadGen Agent prepare Canvas in the LoadGen Director. We now need to adjust the LoadGen Flow to incorporate your test users. 
  1. Click the Flows tab page again and continue with the next steps.
  2. Click Edit.
  3. The LoadGen Studio will open now, you will see the following screen.

Add your Azure Directory Id and App Id

  1. Click the Custom Objects tab.
  2. In the Variables grid, you can see the Azure_TenantId and Azure_AppId, edit these variables with the information from step 3 item 6.

Check the version of AVD

If you are still running AVD in Classic mode, please change the variable WVD_ClassicMode to True.

 

Add your AVD Resource Name

  1. In the Variables grid, you must now add the name of the AVD Resource.
  2. Edit the variable WVD_ResourceName with the correct name of the resource you want to start (this is the name that users see in the Remote Desktop client).

Add your Azure Test users

  1. Click the Repository tab.
  2. Select the Azure Test Users Datasource and press Edit.
  3. Add your own Azure test users, and make sure these users are allowed to start an Azure Virtual Desktop resource.

Debug the Flow

  1. Now start the LoadGen Studio Recorder   
  2. Select the correct Application Block.


  3. Start the Block to debug if this Flow works in your environment
  4. If you see the Azure Virtual Desktops starting up, then all is fine and you can continue.

The flow cannot be replayed because there is no LocalClient session available.

If you receive the following error message: The flow cannot be replayed because there is no LocalClient session available, make sure you have installed the Microsoft Visual C++ 2015, 2017, and 2019 (x64 and x86) download. Available after installation of LoadGen Suite in folder C:\Program Files\LoadGen\LoadGen Shared\Resources.

Run the Prepare Flow

  1. You can now go back to the LoadGen Director.
  2. Click the Run your test tab page.
  3. Press the Start button, the LoadGen Prepare AVD flow will now be replayed at your configured LoadGen Agents. When the LoadGen Agents are prepared you can continue with setting up the AVD test.
  4. Closely monitor your LoadGen Agents to see if every user has logged on successfully.

Next step

Was this article helpful?
0 out of 0 found this helpful