When I was creating my Azure Automation account and tried to run a runbook that needed to logon to Azure, to start my VM’s I was getting an error:
Run Login-AzureAccount to login.
After looking on technet there where a few different recommendations but none worked.
In the end I just decided to try update the Azure modules. This fixed the issue.
Below is how to update the modules.
Go to Automation Accounts > select account > Modules
There will be a prompt to update all Azure modules click yes to continue.
To view the progress click on below.
Click on all logs or output to view what is currently running.
Once completed the below will show.
After this I was successfully able to run my runbooks.