az vm stop

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.

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 AzurelessonsNewVM

Before executing the above command, I logged in to the Azure Portal and verified the status of the Azure VM, which is running.

az vm stop command

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

az vm stop

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.

az vm stop Azure CLI command

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-shutdown

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

az vm stop example

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.

az vm stop examples

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!