Virtual Desktop Streamer startup
Start Virtual Machine on Connect
Is this page helpful?
Please rate your experience
Yes
No
Any additional feedback?
Feedback will be sent to Microsoft: By pressing the submit button, your feedback will be used to improve Microsoft products and services. Privacy policy. Show
Submit
Thank you. In this articleThe Start Virtual Machine (VM) on Connect feature lets you save costs by allowing end users to turn on their VMs only when they need them. You can then turn off VMs when they're not needed. Note Azure Virtual Desktop (classic) doesn't support this feature. Requirements and limitationsYou can enable the start VM on Connect feature for personal or pooled host pools using PowerShell and the Azure portal. The following Remote Desktop clients support the Start VM on Connect feature:
Create a custom role for Start VM on ConnectBefore you can configure the Start VM on Connect feature, you'll need to assign your VM a custom RBAC (role-based access control) role. This role will let Azure Virtual Desktop manage the VMs in your subscription. You can also use this role to turn on VMs, check their status, and report diagnostic info. If you want to know more about what each role does, take a look at Azure custom roles. Note If your VMs and host pool are in different subscriptions, the RBAC role needs to be assigned to the subscription that the VMs are in. Use the Azure portalTo use the Azure portal to assign a custom role for Start VM on Connect:
After that, you'll need to assign the role to grant access to Azure Virtual Desktop. To assign the custom role:
Create a custom role with a JSON file templateIf you're using a JSON file to create the custom role, the following example shows a basic template you can use. Make sure you replace the subscription ID value in AssignableScopes with the subscription ID you want to assign the role to. { "Name": "Start VM on connect (Custom)", "IsCustom": true, "Description": "Start VM on connect with AVD (Custom)", "Actions": [ "Microsoft.Compute/virtualMachines/start/action", "Microsoft.Compute/virtualMachines/*/read" ], "NotActions": [], "DataActions": [], "NotDataActions": [], "AssignableScopes": [ "/subscriptions/00000000-0000-0000-0000-000000000000" ] }To use the JSON template, save the JSON file, add the relevant subscription information to Assignable Scopes, then run the following cmdlet in PowerShell: New-AzRoleDefinition -InputFile "C:\temp\filename"To learn more about creating custom roles, see Create or update Azure custom roles using Azure PowerShell. Configure the Start VM on Connect featureNow that you've assigned your subscription the role, it's time to configure the Start VM on Connect feature! Deployment considerationsStart VM on Connect is a host pool setting. If you only want a select group of users to use this feature, make sure you only assign the required role to the users you want to add. For personal desktops, the feature will only turn on an existing VM that the service has already assigned or will assign to a user. In a pooled host pool scenario, the service will only turn on a VM when none are turned on. The feature will only turn on additional VMs when the first VM reaches the session limit. Important You can only configure this feature in existing host pools. This feature isn't available when you create a new host pool. Use the Azure portalTo use the Azure portal to configure Start VM on Connect:
Use PowerShellTo configure this setting with PowerShell, you need to make sure you have the names of the resource group and host pools you want to configure. You'll also need to install the Azure PowerShell module (version 2.1.0 or later). To configure Start VM on Connect using PowerShell:
User experienceIn typical sessions, the time it takes for a user to connect to a deallocated VM increases because the VM needs time to turn on again, much like turning on a physical computer. The Remote Desktop client has an indicator that lets the user know the PC is being powered on while they're connecting. TroubleshootingIf the feature runs into any issues, we recommend you use the Azure Virtual Desktop diagnostics feature to check for problems. If you receive an error message, make sure to pay close attention to the message content and copy down the error name somewhere for reference. You can also use Azure Monitor for Azure Virtual Desktop to get suggestions for how to resolve issues. If the VM doesn't turn on, you'll need to check the health of the VM you tried to turn on before you do anything else. Next stepsIf you run into any issues that the troubleshooting documentation or the diagnostics feature couldn't solve, check out the Start VM on Connect FAQ. |