Azure DevTest Labs: Set expiration date for a virtual machine

Dienstag, 2. August 2016

In Azure DevTest Labs, you can now set an expiration date and time for a virtual machine. The VM will be deleted within 24 hours of the specified date and time. The time is in UTC.

You can do this by using an Azure Resource Manager template—namely, by specifying the expirationDate property for the VM that will be created in the lab. You can check out a sample Resource Manager template in our public GitHub repository. You can also modify any of the existing sample Resource Manager templates for the VM creation (name starting with 101-dtl-create-vm) by specifying the expirationDate property as follows.

"resources": [
    {
      "apiVersion": "2016-05-15",
      "type": "Microsoft.DevTestLab/labs/virtualMachines",
      "name": "[variables('resourceName')]",
      "location": "[resourceGroup().location]",
      "properties": {
        "customImageId": "[parameters('existingCustomImageId')]",
        "size": "[parameters('newVMSize')]",
        "isAuthenticationWithSshKey": false,
        "userName": "[parameters('userName')]",
        "sshKey": "",
        "password": "[parameters('password')]",
        "labVirtualNetworkId": "[variables('labVirtualNetworkId')]",
        "labSubnetName": "[variables('labSubnetName')]",
        "expirationDate": "[parameters('expirationDate')]"
      }
 
    }
  ],

 

Please try the new feature and let us know how we can make it better by sharing your ideas and suggestions at the DevTest Labs feedback forum.

If you run into any problems with the feature or have any questions, we are always ready to help you at our MSDN forum.

 

 

 

Kostenloses Konto

Mit einem Guthaben von $200 lernen und erstellen und von weiteren kostenlosen Produkten profitieren

Kostenlos starten

Visual Studio

Abonnenten erhalten bis zu $1800 jährlich für Azure-Dienste

Jetzt aktivieren

Startups

Machen Sie mit beim BizSpark-Programm, und nutzen Sie kostenlose Azure-Dienste.

Weitere Informationen