Skip to content

Instantly share code, notes, and snippets.

@irwinwilliams
Created May 3, 2016 04:18
Show Gist options
  • Save irwinwilliams/ca428b195105d8a519e2b75e76374873 to your computer and use it in GitHub Desktop.
Save irwinwilliams/ca428b195105d8a519e2b75e76374873 to your computer and use it in GitHub Desktop.
Start/Stop a classic Azure VM using the azure cli (needs jq installed)
azure login -u <username>
azure config mode asm
export vm_name=<vmname>
export vm_state="$1"
azure vm $vm_state $vm_name
azure vm show $vm_name --json | jq -s .[].InstanceStatus
azure config mode arm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment