Stopping Virtual Machines

# resouce group name
# pluralsight-autolab-rg

# run
https://docs.microsoft.com/en-us/cli/azure/vm?view=azure-cli-latest
az vm stop --ids $(az vm list -g MyResourceGroup --query "[].id" -o tsv)

# output
About to power off the specified VM...
It will continue to be billed. To deallocate a VM, run: az vm deallocate.

# Dealocate
az vm deallocate --ids $(az vm list -g pluralsight-autolab-rg --query "[].id" -o tsv)


# Start a vm
az vm start --resource-group myResourceGroup --name myVM
Previous
Next