When adding solutions to your OMS workspace you might get prompted to specify an Azure Automation account which then results in a link being created between the OMS workspace and the Azure Automation account. Now let’s assume you don’t need a specific OMS solution but you still want to create a link to an Automation account. While there is an “unlink workspace” option in the Azure portal, there is no “link workspace option” .
Also within the OMS portal, there no option to directly link the workspace to an automation account.
And as long as there is no connection, no runbooks can be selected in the Alert configuration screen.
Now here’s the trick, just start the process of adding a solution that requires an automation account. For this example I use the “Change Tracking” solution.
Next select “Configure Workspace”
Complete the workspace configuration, this will create the link between the OMS Workspace and the Azure Automation account. When completed, you will see a dialog where you can add the solution. There is no need to continue or add the solution, the link is already created.
and within the Azure portal, we can now select the linked workspace from the Automation account blade.
and last but not least, to unlink the workspace, select the “Unlink workspace” option.
I searched, but there does not seem to be any PowerShell cmdlets around yet that would allow automate these steps.
Thank you, Thank you, Thank you!
I have spent 2 days re-creating Azure resource groups in different locations with the Automation and OMS services but this is all i needed to get them to see each other – thank you!
Thank you, this was exactly the issue I was having and this solved it for me. Odd that one has to use such a roundabout way to link a Workspace to an Automation account. Hopefully Microsoft will fix this in the future.
Is there a way to do this using ARM Templates. am struggling to automate the entire OMS solutions with ARM Templates but could not link OMS work space with Automation account using ARM Template
Microsoft now has a powershell script to do this, and it has worked for me:
https://docs.microsoft.com/en-us/azure/automation/automation-manage-send-joblogs-log-analytics