|
| 1 | +--- |
| 2 | +title: Set a dev box auto-stop schedule |
| 3 | +titleSuffix: Microsoft Dev Box |
| 4 | +description: Learn how to configure stop on disconnect to automatically stop dev boxes in a pool when a user . |
| 5 | +services: dev-box |
| 6 | +ms.service: dev-box |
| 7 | +ms.custom: devx-track-azurecli |
| 8 | +author: dhruvmu |
| 9 | +ms.author: rosemalcolm |
| 10 | +ms.date: 01/10/2024 |
| 11 | +ms.topic: how-to |
| 12 | +--- |
| 13 | + |
| 14 | +# Auto-stop your Dev Boxes on schedule |
| 15 | + |
| 16 | +To save on costs, you can configure your Dev Box pools to stop when a user disconnects from their RDP session |
| 17 | + |
| 18 | +> [!NOTE] |
| 19 | +> Stop on disconnect will only apply to Dev Boxes that are 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](./how-to-configure-dev-box-hibernation.md) |
| 20 | +
|
| 21 | +## Permissions |
| 22 | + |
| 23 | +To manage a dev box schedule, you need the following permissions: |
| 24 | + |
| 25 | +| Action | Permission required | |
| 26 | +|---|---| |
| 27 | +| _Configure a schedule_ | Owner, Contributor, or DevCenter Project Admin. | |
| 28 | + |
| 29 | + |
| 30 | +## Manage an auto-stop schedule with the Azure CLI |
| 31 | + |
| 32 | +You can manage stop on disconnect settings on dev box pools by using the Azure CLI. |
| 33 | + |
| 34 | + |
| 35 | +### Update a pool wiith stop on disconnect |
| 36 | + |
| 37 | +The following Azure CLI command enables stop on disconnect on a dev box pool: |
| 38 | + |
| 39 | +```azurecli |
| 40 | +az devcenter admin pool update --pool-name {poolName} --project {projectName} --resource-group {resourceGroupName} --stop-on-disconnect status="Enabled" grace-period-minutes="180" |
| 41 | +``` |
| 42 | + |
| 43 | +| Parameter | Value | |
| 44 | +|---|---| |
| 45 | +| `pool-name` | Name of your dev box pool. | |
| 46 | +| `project` | Name of your dev box project. | |
| 47 | +| `resource-group` | Name of the resource group for your dev box pool. | |
| 48 | +| `grace-period-minutes` | Duration to wait after the user disconnects from an RDP session before stopping the dev box, in minutes| |
| 49 | +| `status` | Indicates whether the schedule is in use. The options include `Enabled` or `Disabled`. | |
| 50 | + |
| 51 | +### Disable stop on disconnect |
| 52 | + |
| 53 | +The following Azure CLI command enabdisablesles stop on disconnect on a dev box pool: |
| 54 | + |
| 55 | +```azurecli |
| 56 | +az devcenter admin pool update --pool-name {poolName} --project {projectName} --resource-group {resourceGroupName} --stop-on-disconnect status="Disabled" |
| 57 | +``` |
| 58 | + |
| 59 | +| Parameter | Value | |
| 60 | +|---|---| |
| 61 | +| `pool-name` | Name of your dev box pool. | |
| 62 | +| `project-name` | Name of your dev box project. | |
| 63 | + |
| 64 | +## Related content |
| 65 | +- [How to configure dev box hibernation](./how-to-configure-dev-box-hibernation.md) |
| 66 | +- [Manage a dev box definition](./how-to-manage-dev-box-definitions.md) |
| 67 | +- [Manage a dev box by using the developer portal](./how-to-create-dev-boxes-developer-portal.md) |
0 commit comments