In this article, I will walk you through the syntax and usage of the az vm stop command with certain examples of how to use this command.
Table of Contents
az vm stop
This Azure CLI command helps to power off (stop) a running Azure VM.
Syntax
az vm stop [--ids][--name][--resource-group]Example-1
The below command helps you to power off (stop) a running Azure VM named AzurelessonsNewVM that belongs to the newresgroup Resource Group.
az vm stop --resource-group newresgroup --name AzurelessonsNewVMBefore executing the above command, I logged in to the Azure Portal and verified the status of the Azure VM, which is running.

Now, let us execute the above command; I got the expected output, as shown in the screenshot below.

Now, to cross-check, let us log in to the Azure Portal, and you can see the status has been changed successfully to stopped, as shown below.

Example-2
The below command helps you to power off (stop) a running Azure VM named AzurelessonsNewVM without shutting down that belongs to the newresgroup Resource Group.
az vm stop --resource-group newresgroup --name AzurelessonsNewVM --skip-shutdownAfter executing the above command, I got the expected output as shown below.

Now, to cross-check, I logged in to the Azure Portal and could see the status of the Azure VM status changed successfully to Stopped.

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.
