In scenarios such as training, demos and trials, you may want to create virtual machines and delete them automatically after a fixed duration so that you don’t incur unnecessary costs. We recently announced a feature which allows you to do just that; set an expiration date for a lab VM.
This feature is currently only available using our APIs which you can use through Azure resource manager (ARM) template, Azure PowerShell SDK and Azure CLI.
You can create a lab VM with an expiration date using an ARM template by specifying the expirationDate property for the VM. 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 adding the expirationDate property.
For more details on this feature and what’s coming next, please check out the post on our team blog.
Please try this feature and let us know how we can make it better by sharing your ideas and suggestions at the DevTest Labs feedback forum. Note that this feature will be available soon in the Azure portal as well.
If you run into any problems with this feature or have any questions, we are always ready to help you at our MSDN forum.