In this part of my OMS blog post series I want to show you something about the Azure Automation integration within OMS.
Azure Automation is basically a stand-alone SaaS solution within Azure. It’s like a combination of an DSC Pull Server and the Service Management Automation runtime on the Azure Cloud. AA is one of my favorite Azure solutions because it’s cheap and very powerful. You can trigger PowerShell based runbooks by an authentication less Webhook, which makes it really easy to use. Also every runbook can be triggered by Azure REST API or the Azure Portal. But now, what’s the cool stuff behind AA within OMS? – That’s the cool thing. AA within OMS enables you to deploy Hybrid Workers. These Hybrid Workers are running within the OMS Agent and running those Cloud managed runbooks on premises. This enables you to build up powerful runbooks which can access on premises services like Active Directory Domain Services.
The next few steps will provide an overview on how to implement Hybrid Workers.
- Step, adding the Azure Automation solution from the Solutions Gallery to your OMS workspace
2. On the OMS Dashboard click on the solution
3. Select your Azure Automation account to combine it with OMS (If you do not have any, or want to create a dedicated one, simply click on ‘Create a new …’)
4. Azure Automation is now integrated with the OMS workspace
5. Switch to the Azure Portal and select the Azure Automation Account
6. Click on Hybrid Worker Groups -> Configure
7. On the Windows System, which will host the Hybrid Worker, make sure the Microsoft Monitoring Agent is installed and connected to OMS. Then import the Hybrid Registration PowerShell Module.
8. Check for the Access Key and the URL from the Azure Portal
9. Us e the Add-HybridRunbookWorker cmdlet to add the new Hybrid Worker. As Endpoint use the URL and as Token the Access Key
Add-HybridWorker -Name <Name> -EndPoint <URL> -Token <Access Key>
10. Within the Azure Portal the new Hybrid Worker is now visible.
After these ten steps the Hybrid Worker is now usable. Now, let’s test the Hybrid Worker with a new PowerShell Runbook:
The simple script:
Import-Module ActiveDirectory $dom = get-ADDomain Write-Output $dom
will import the ADDS module and print the information’s about the domain, which the Hybrid Worker Server is joint.
To trigger the Runbook it’s possible to select the “Test”-pane. Select the Hybrid Worker to queue the new execution job. All results will be directly displayed.
I hope you enjoy Azure Automation with Hybid Workers as much as I do. Keep in mind, it’s also possible to create Webhooks for Runbooks to run the Runbook on a Hybrid Worker!