az vm auto-shutdown

This article will walk you through the syntax and usage of the az vm auto-shutdown Azure CLI command with particular examples.

az vm auto-shutdown

This command helps you to manage auto-shutdown schedule for a VM.

Syntax

Below is the syntax of the az vm auto-shutdown command.

az vm auto-shutdown [--email] [--name] [--off][--resource-group][--time][--webhook]

Example-1

The example below shows that the command below will help delete the auto-shutdown schedule for a VM named AzurelessonsNewVM that belongs to the Testing Resource Group.

az vm auto-shutdown -g Testing -n AzurelessonsNewVM --off

After executing the above command, I got the expected output as shown in the screenshot below.

az vm auto-shutdown

Now, when I verified the auto shutdown status of the Azure VM in the portal, you can see that the status has been updated to Off, as shown in the screenshot below.

az vm auto shutdown powershell

Example-2

The Azure CLI script below creates an auto-shutdown schedule for a VM named AzurelessonsNewVM in the Testing Resource Group.

az vm auto-shutdown -g Testing -n AzurelessonsNewVM --time 1830 --email "abc@tar.com" --webhook "https://xyz.com/"

You may also like following the articles below.

Azure Virtual Machine

DOWNLOAD FREE AZURE VIRTUAL MACHINE PDF

Download our free 25+ page Azure Virtual Machine guide and master cloud deployment today!