Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

https://docs.microsoft.com/en-us/azure/automation/automation-solution-vm-management

For this example to work the automation account needs to have a system assigned identity and it should have the "Virtual Machine Contributor" role assigned to the resource group the virtual machine is running in.

As an example see the following runbook that will stop a VM with the name OC-0:

...