I'm looking for a way to use my machine-local PowerShell ISE or VSCode to connect to Azure Runbooks. Usually, one has to scaffold locally and then test in the cloud in an Azure runbook. Has anybody ever done this?
One way I'm looking into it is this idea but I was wondering if you knew of something more convenient.
To connect from local (VScode) to Azure Runbooks:
Thanking @Kaido Järvemets for detailed steps. I've tried by considering few steps from there and was able to connect successfully.
To work with Azure automation from local, we need to set up a few settings by searching "Preferences: User settings" (ctrl+shift+p
).
Register a new application under Azure Active Directory and add the respective "client_id, client_secret, automation_account_name, subscription_id,tenant_id" in extension settings of Azure Automation configuration.
Automation Account -> Access Control (IAM)
as shown here:Created a PowerShell runbook script to run connect-AzAccount
under Azure Automation Account through portal.
Opened the same runbook in Azure Automation and was able to connect from local (vscode)to Azure.
Note: Search for Automation explorer (ctrl+shift+p
) and create a new runbook if needed. you can run the same script in Azure portal also & it will work as described above.