Skip to content

Commit 78b31cf

Browse files
committed
add cli
1 parent 3b40670 commit 78b31cf

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

articles/virtual-desktop/start-virtual-machine-connect.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,34 @@ You need to make sure you have the names of the resource group and host pool you
8787
8888
# [Azure CLI](#tab/azure-cli)
8989
90-
To configure Start VM on Connect using Azure CLI:
90+
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
91+
92+
[!INCLUDE [include-cloud-shell-local-cli](includes/include-cloud-shell-local-cli.md)]
93+
94+
2. To enable or disable Start VM on Connect, do one of the following steps:
95+
1. To enable Start VM on Connect, run the following command, replacing the value for `-ResourceGroupName` and `-Name` with your values:
96+
97+
```azurecli
98+
az desktopvirtualization hostpool update \
99+
--resource-group $resourceGroupName \
100+
--name $hostPoolName \
101+
--start-vm-on-connect true
102+
```
103+
104+
1. To disable Start VM on Connect, run the following command, replacing the value for `-ResourceGroupName` and `-Name` with your values:
105+
106+
```azurecli
107+
az desktopvirtualization hostpool update \
108+
--resource-group $resourceGroupName \
109+
--name $hostPoolName \
110+
--start-vm-on-connect false
111+
```
112+
91113
92114
---
93115
116+
117+
94118
>[!NOTE]
95119
>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."
96120

0 commit comments

Comments
 (0)