Forrest logo
back to the az tool

az-vm:tldr:bf182

az-vm: Stop a Virtual Machine.
$ az vm stop --resource-group ${rg} --name ${vm_name}
try on your machine

This command is used in the Azure command-line interface (CLI) to stop a virtual machine (VM) in Azure. Here's a breakdown of the different parts of the command:

  • az vm stop: This is the base command to stop a VM.
  • --resource-group ${rg}: This option specifies the resource group of the VM. The ${rg} is a placeholder for the actual name of the resource group. You need to replace ${rg} with the name of the resource group where the VM is located.
  • --name ${vm_name}: This option specifies the name of the VM that you want to stop. Similar to the previous option, ${vm_name} is a placeholder for the actual name of the VM. You need to replace ${vm_name} with the name of the VM you want to stop.

By executing this command, the specified VM in the given resource group will be stopped, which means it will be deallocated, and you won't be billed for its compute resources anymore.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the az tool