azure,

Azure VMs Auto-shutdown

Sep 08, 2021 · 1 min read · Post a comment

Talking about VMs shutdown operation, we got few ways we could do it in Azure:

  1. Stop VMs manually from the Portal.
  2. Running the az CLI command, described in How to easily Start, Stop, Restart or Delete Azure VMs.
  3. Using Azure PowerShell module.
  4. Using the REST API.
  5. Talking about dozens of VMs, Schedule Automated Start and Stop for Azure VMs.
  6. And the last but not least, the Azure auto-shutdown feature that we’ll describe in the steps below.

Prerequisites

  • Azure subscription
  • Azure VM

Azure Auto-shutdown feature

Step 1. Open a browser and login to the Azure Portal.

Step 2. Type VMs in the search console, and click Virtual Machines.

Step 3. Click on the VM you want to implement this feature, and click Auto-shutdown under Operations.
azure vm auto-shutdown

Step 4. Update the configuration according to your scenario:
azure vm auto-shutdown config

Note(s):

  • If you want to enable notification, as in the screenshot above, the email address is a required field though.
  • Webhook URL option could be used as well, in case you need to trigger any event, after the VM shutdown operation.
  • You could also configure the Auto-shutdown feature during the VM creation.

Step 5. Click Save.

Conclusion

To sum it up, Auto-shutdown feature could definitely save us time from doing the things the old school way, by writing and scheduling PowerShell, bash, or even az command scripts. Feel free to leave a comment below and if you find this tutorial useful, follow our official channel on Telegram.