This article will walk you through the syntax and usage of the az vm auto-shutdown Azure CLI command with particular examples.
Table of Contents
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 --offAfter executing the above command, I got the expected output as shown in the screenshot below.

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.

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.

I am Rajkishore, and I am a Microsoft Certified IT Consultant. I have over 14 years of experience in Microsoft Azure and AWS, with good experience in Azure Functions, Storage, Virtual Machines, Logic Apps, PowerShell Commands, CLI Commands, Machine Learning, AI, Azure Cognitive Services, DevOps, etc. Not only that, I do have good real-time experience in designing and developing cloud-native data integrations on Azure or AWS, etc. I hope you will learn from these practical Azure tutorials. Read more.
