How to deallocate the Azure VM using Azure CLI in PowerShell?


To deallocate the Azure VM using Azure CLI, we need to use the VM deallocation command az vm deallocate and need to provide the name of the VM and the resource group of the VM.

Before running the deallocation command, make sure that you are connected to the proper azure subscription and the azure account.

PS C:\> az vm deallocate -n VMName -g RGName --verbose

Or you can use

PS C:\> az vm deallocate --name VMName --resource-group RGName --verbose

If you are working on the multiple VMs, you can also apply the --no-wait parameter to continue next operation without waiting for the VM to stop.

PS C:\> az vm deallocate -n VmName -g RGName --no-wait --verbose

Updated on: 02-Sep-2021

2K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements