You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/virtual-desktop/start-virtual-machine-connect.md
+38-18Lines changed: 38 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,6 +29,7 @@ The time it takes for a user to connect to a session host VM that is powered off
29
29
To use Start VM on Connect, make sure you follow these guidelines:
30
30
31
31
- You can only configure Start VM on Connect on existing host pools. You can't enable it at the same time you create a new host pool.
32
+
32
33
- The following Remote Desktop clients support Start VM on Connect:
33
34
- The [Windows client](./users/connect-windows.md?toc=/azure/virtual-desktop/toc.json&bc=/azure/virtual-desktop/breadcrumb/toc.json) (version 1.2.2061 or later)
34
35
- The [Web client](./users/connect-web.md?toc=/azure/virtual-desktop/toc.json&bc=/azure/virtual-desktop/breadcrumb/toc.json)
@@ -37,8 +38,13 @@ To use Start VM on Connect, make sure you follow these guidelines:
37
38
- The [Android and Chrome OS client](./users/connect-android-chrome-os.md?toc=/azure/virtual-desktop/toc.json&bc=/azure/virtual-desktop/breadcrumb/toc.json) (version 10.0.10 or later)
38
39
- The [Microsoft Store client](./users/connect-microsoft-store.md?toc=/azure/virtual-desktop/toc.json&bc=/azure/virtual-desktop/breadcrumb/toc.json) (version 10.2.2005.0 or later)
39
40
- Thin clients listed in [Thin client support](./users/connect-thin-clients.md?toc=/azure/virtual-desktop/toc.json&bc=/azure/virtual-desktop/breadcrumb/toc.json)
41
+
40
42
- If you want to configure Start VM on Connect using PowerShell, you'll need to have [the Az.DesktopVirtualization PowerShell module](https://www.powershellgallery.com/packages/Az.DesktopVirtualization) (version 2.1.0 or later) installed on the device you use to run the commands.
43
+
41
44
- You must grant Azure Virtual Desktop access to power on session host VMs, check their status, and report diagnostic information. You must have the `Microsoft.Authorization/roleAssignments/write` permission on your subscriptions in order to assign the role-based access control (RBAC) role for the Azure Virtual Desktop service principal on those subscriptions. This is part of **User Access Administrator** and **Owner** built in roles.
45
+
46
+
- The Azure account you use to configure Start VM on Connect must have the [Desktop Virtualization Host Pool Contributor](rbac.md#desktop-virtualization-host-pool-contributor) role assigned.
47
+
42
48
- If you enable Start VM on Connect on a host pool, you must make sure that the host pool name, the names of the session hosts in that host pool, and the resource group name don't have non-ANSI characters. If their names contain non-ANSI characters, then Start VM on Connect won't work as expected.
43
49
44
50
## Assign the Desktop Virtualization Power On Contributor role with the Azure portal
@@ -53,7 +59,7 @@ To learn how to assign the *Desktop Virtualization Power On Contributor* role to
53
59
54
60
Now that you've assigned the *Desktop Virtualization Power On Contributor* role to the service principal on your subscriptions, you can configure Start VM on Connect using the Azure portal or PowerShell.
55
61
56
-
# [Portal](#tab/azure-portal)
62
+
# [Azure portal](#tab/azure-portal)
57
63
58
64
To configure Start VM on Connect using the Azure portal:
59
65
@@ -69,27 +75,13 @@ To configure Start VM on Connect using the Azure portal:
69
75
70
76
2. Select **Save** to apply the settings.
71
77
72
-
# [PowerShell](#tab/azure-powershell)
78
+
# [Azure PowerShell](#tab/azure-powershell)
73
79
74
80
You need to make sure you have the names of the resource group and host pool you want to configure. To configure Start VM on Connect using PowerShell:
75
81
76
-
1. Open a PowerShell prompt.
77
-
78
-
1. Sign in to Azure using the `Connect-AzAccount` cmdlet. For more information, see [Sign in with Azure PowerShell](/powershell/azure/authenticate-azureps)
79
-
80
-
1. Find the name of the subscription that contains host pools and session host VMs you want to use with Start VM on Connect by listing all that are available to you:
1. Change your current Azure session to use the subscription you identified in the previous step, replacing the value for `-SubscriptionName` with the name or ID of the subscription:
87
-
88
-
```powershell
89
-
Set-AzContext -Subscription "<subscription name or id>"
90
-
```
91
-
92
-
1. To enable or disable Start VM on Connect, do one of the following steps:
84
+
2. To enable or disable Start VM on Connect, do one of the following steps:
93
85
94
86
1. To enable Start VM on Connect, run the following command, replacing the value for `-ResourceGroupName` and `-Name` with your values:
95
87
@@ -103,8 +95,36 @@ You need to make sure you have the names of the resource group and host pool you
2. To enable or disable Start VM on Connect, do one of the following steps:
105
+
1. To enable Start VM on Connect, run the following command, replacing the value for `--resource-group` and `--name` with your values:
106
+
107
+
```azurecli
108
+
az desktopvirtualization hostpool update \
109
+
--resource-group $resourceGroupName \
110
+
--name $hostPoolName \
111
+
--start-vm-on-connect true
112
+
```
113
+
114
+
1. To disable Start VM on Connect, run the following command, replacing the value for `--resource-group` and `--name` with your values:
115
+
116
+
```azurecli
117
+
az desktopvirtualization hostpool update \
118
+
--resource-group $resourceGroupName \
119
+
--name $hostPoolName \
120
+
--start-vm-on-connect false
121
+
```
122
+
123
+
106
124
---
107
125
126
+
127
+
108
128
>[!NOTE]
109
129
>In pooled host pools, Start VM on Connect will start a VM every five minutes at most. If other users try to sign in during this five-minute period while there aren't any available resources, Start VM on Connect won't start a new VM. Instead, the users trying to sign in will receive an error message that says, "No resources available."
0 commit comments