Azure Lab Services REST API

David Downing 741 Reputation points

I'm trying to call a REST API to set the "Auto-shutdown of virtual machines". I thought it would be on the Create Lab API, but I can't seem to find it.

Any assistance is greatly appreciated.

Thank you,

Azure Lab Services
Azure Lab Services
An Azure service that is used to set up labs for classrooms, trials, development and testing, and other scenarios.
216 questions
No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Samara Soucy - MSFT 21 Reputation points

    Hi David,

    Version 2019/01/01-preview documenation isn't publicly available for Lab Services, but the property exists on that version of the to set the auto shutdown in the labaccounts endpoint. Keep in mind that as a preview endpoint, this could change in the future.

    You would need to take the Create/Update endpoint and change the API version:


    The Properties section has more options in this version. In particular, I think you are looking for the idleGracePeriod
    and the idleShutdownMode options.

        "id": "/subscriptions/{TenantID}/resourcegroups/{ResourceGroup}/providers/microsoft.labservices/labaccounts/{LabName}",  
        "location": "eastus2",  
        "name": "{LabName}",  
        "properties": {  
            "clientConnections": "Disabled",  
            "enabledRegionSelection": false,  
            "geo": "unitedstates",  
            "idleGracePeriod": "PT10M",  
            "idleShutdownMode": "OnDisconnect",  
            "labServicesObjectId": "",  
            "provisioningState": "Succeeded",  
            "sizeConfiguration": null,  
            "uniqueIdentifier": "db132e95-bb93-4902-9598-0ecbb7917ca4",  
            "virtualNetworkResourceId": null  
        "tags": {  
        "type": "Microsoft.LabServices/labAccounts"