Edit

Share via


Stop your Dev Boxes automatically when users disconnect

To save on costs, you can configure your Dev Box pools to stop when a user disconnects from their RDP session, after a timeout period that you can configure. Microsoft Dev Box attempts to stop all dev boxes after a user disconnects, and they don't re-establish a new RDP session within the configured timeout period.

Note

Stop on disconnect applies only apply Dev Boxes created with hibernation-enabled Dev Box definitions. To learn more about enabling hibernation on your Dev Box definitions, see How to configure dev box hibernation.

Prerequisites

To manage stop-on-connect settings on a dev box pool, you need the following permissions:

Action Permission required
Configure a pool Owner, Contributor, or DevCenter Project Admin.

Manage stop on disconnect settings with the Azure CLI

You can manage stop on disconnect settings on dev box pools by using the Azure CLI.

Update a pool with stop on disconnect

The following Azure CLI command enables stop on disconnect on a dev box pool:

az devcenter admin pool update --pool-name {poolName} --project {projectName} --resource-group {resourceGroupName} --stop-on-disconnect status="Enabled" grace-period-minutes="180"
Parameter Value
pool-name Name of your dev box pool.
project Name of your dev box project.
resource-group Name of the resource group for your dev box pool.
grace-period-minutes Duration to wait after the user disconnects from an RDP session before stopping the dev box. The value must be between 60 and 480 minutes.
status Indicates whether stop on disconnect is in use. The options include Enabled or Disabled.

Disable stop on disconnect

The following Azure CLI command disables stop on disconnect on a dev box pool:

az devcenter admin pool update --pool-name {poolName} --project {projectName} --resource-group {resourceGroupName} --stop-on-disconnect status="Disabled" 
Parameter Value
pool-name Name of your dev box pool.
project-name Name of your dev box project.
status A value of Disabled indicates to not stop the Dev Box when the user disconnects.