You create an Azure Automation Account with an Azure PowerShell runbook to stop Azure Virtual Machines (VMs) with a given tag.
When you execute this runbook, you see the error message shown in the exhibit.
You need to fix the runbook.
What should you do?
You should import the Az.Compute module from the modules gallery. This kind of error occurs when you try to run a runbook without the required modules installed. You can import the Az.Compute module from the modules gallery to enable the Get-AzVM PowerShell cmdlet and fix the error shown in the exhibit.
You should not update the AzureRM.Compute module from the modules gallery. This module is available by default in the Automation Account. You can use this module if your runbook uses the AzureRM PowerShell module to stop Azure VMs, like the Get-AzureRmVM cmdlet.
You should not create a new Azure Automation Run As account. The Azure Automation Run As account is a service principal with the Contributor role at the subscription level and is used by the Azure Automation Account. You would see a different error message if the runbook failed for insufficient permission reasons.
You should not re-create the runbook as a graphical runbook. You can use a graphical runbook to create a PowerShell-based script using a graphical editor. Re-creating the runbook and using the Get-AzVM PowerShell cmdlet would result in the same error if you did not import the Az.Compute module.