Home » Auto shutdown Azure virtual machines

Auto shutdown Azure virtual machines

I already blogged about how to Automatically shutdown virtual machines in Azure. The previous post is still useful if you want to shutdown a group (or all) of virtual machines at the same time. It uses the automation service to get the virtual machines and shuts them down. So you can control it at one place.

At November 22, 2016, Microsoft announced a new feature which makes it easy to configure the auto shutdown for a virtual machine: https://azure.microsoft.com/en-us/updates/set-auto-shutdown-within-a-couple-of-clicks-for-vms-using-azure-resource-manager/.

This new feature is available in the Azure portal. Just navigate to your virtual machine, scroll down to “Schedules” and select “Auto-shutdown”:

20161201_01_autoshutdownvm

You can easily configure the schedule and there is also a property for a webhook that will be called when the auto-shutdown is about to happen. So if you want to log the shutdown, receive an email or anything else, then you can use Azure functions or logic apps to perform an action. Both of them allow to configure a HTTP trigger that can be called from the auto-shutdown.

If you want to auto-shutdown multiple virtual machines at once, then I still recommend to use the automation service as described here: Automatically shutdown virtual machines in Azure

Leave a Reply

Your email address will not be published. Required fields are marked *