跳到主内容

Azure DevTest Labs: Set expiration date for a virtual machine

发布日期:八月 02, 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.

 

 

 

  • 虚拟机
  • Azure 开发测试实验室
  • Features
  • Services