Configuring Remote Desktop settings with Azure DevTest Labs


Azure DevTest Labs is often used in enterprise environments leveraging Express Route or Site to Site VPN with secure remote access enabled via a Remote Desktop Gateway.  To improve the experience in this environment, we have a new feature focused on smoothing out the ‘Connect’ experience to Virtual Machines in the lab.  Now the DevTest Lab Owner (or IT Administrator) can embed settings for Remote Desktop Gateway and the Remote Desktop Experience Index into the DevTest Lab directly!  Although there isn’t any interface (yet) to configure the remote desktop settings in a DevTest Lab, this can still be accomplished via Azure Powershell.

When initiating a remote desktop connection (start -> run, “mstsc”), there are settings that impact the behavior of the remote desktop connection.  In the screenshots below, you’ll see both the “Experience Index” and the “Remote Desktop Gateway” settings.  Once you configure the lab with these settings, whenever a user clicks the “Connect” button on their Virtual Machine, it will include the appropriate settings.

“Experience” tab

The drop-down on approximate speed indicates how much ‘data’ should be sent over the network.  In constrained network environments (like Site to Site VPN to connect to your lab), there will be many people connecting to the lab’s resources and it’s important to save as much bandwidth as possible.  The new “RdpConnectionType” extended property maps to the Experience drop-down this way:

RdpConectionType Configuration

  • 1 - Modem (56 kbps)
  • 2 - Low-speed broadband (256kbps – 2 Mbps)
  • 3 - Satellite (2 Mbps – 16 Mbps with high latency)
  • 4 - High-speed broadband (2 Mbps – 10 Mbps)
  • 5 - WAN (10 Mbps or higher with high latency)
  • 6 - LAN (10 Mbps or higher)
  • 7 - Detect connection quality automatically

(Default setting is 7 in the Remote Desktop Client)

“Advanced” tab – Remote Desktop Gateway

The other important remote desktop connection setting that’s necessary for enterprise environments is configuring a Remote Desktop Gateway for the connection.  There is an example in the screenshot below of a configured RD Gateway settings.

Updating the Remote Desktop settings

Although there isn’t UI available yet to update these settings, there’s a powershell script to use.  You can also use the DevTest Labs RestAPI directly as well.

The script is located hereSet-DTL_RemoteDesktopSettings.ps1

 # Set only the Remote Desktop Gateway property for a lab

.\Set-DTL-RemoteDesktopSettings.ps1 -DevTestLabName "TeamA_DevResources" `

-RemoteDesktopGateway "customrds.eastus.cloudapp.azure.com"

# Set only the Experience Level property for a lab

.\Set-DTL-RemoteDesktopSettings.ps1 -DevTestLabName "TeamA_DevResources" `

-ExperienceLevel 2

# Clear the Remote Desktop Gateway and Experience level properrties in a lab

.\Set-DTL-RemoteDesktopSettings.ps1 -DevTestLabName "TeamA_DevResources"

Additional Details

The key to configuring this correctly is in the “extendedProperties” part of the Lab Properties.  Here is an example of the extended properties with the new Remote Desktop ones highlighted:

{
    "properties": {
        "defaultStorageAccount": "",
        "defaultPremiumStorageAccount": "",
        "artifactsStorageAccount": "",
        "premiumDataDiskStorageAccount": "",
        "vaultName": "",
        "labStorageType": "Standard",
        "createdDate": "2018-06-03T23:26:00.5259483+00:00",
        "premiumDataDisks": "Disabled",
        "environmentPermission": "Reader",
        "announcement": {
            "markdown": "",
            "title": "",
            "enabled": "Disabled",
            "expirationDate": ""
        },
        "support": {
            "enabled": "Disabled",
            "markdown": ""
        },
        "extendedProperties": {
            "RdpConnectionType": "2",
            "RdpGateway": "customrds.eastus.cloudapp.azure.com"
        },
        "provisioningState": "Succeeded",
        "uniqueIdentifier": "7866e06e-7c34-45b2-ab97-7f2f87ef4cd7"
    },
    "id": "",
    "name": "",
    "type": "Microsoft.DevTestLab/labs",
    "location": "eastus",
    "tags": {}
}

Please let us know how we can continue to improve DevTest Labs by sharing your ideas and suggestions at the DevTest Labs feedback forum.

If you run into any problems with the features or have any questions, we are always ready to help you at our MSDN forum.

image Peter Hauge, Principle Software Engineer

Peter is part of the Visual Studio and .Net engineering team focused Visual Studio and Azure customers. He has been at Microsoft for 15 years, working on developer technologies throughout that time.


Comments (0)

Skip to main content