Table of Contents
Hybrid Workers in Azure Automation
When Update Management in Azure Automation was released, you could (and still) add a system Hybrid Worker to Azure Automation via the Log Analytics agent. Only you could no longer use it as a User Hybrid Worker in the User Hybrid Worker Groups and you therefore no longer see it when you want to run a script on a Hybrid Worker.
I started with a new customer where we convert old scripts from Resolve to Azure Automation. I can set up the Azure Automation environment myself, the Hybrid Worker was already added by the Operations team. This was only added via the Management Agent.
So, what now?
Fortunately, we are already a few years further with the development of Azure Automation, so I dived into the Docs.microsoft.com of Azure Automation and then I noticed the following:
This means that you can add the System Hybrid Worker to a User Hybrid Worker Group. Top! If a user Hybrid Worker Group does not yet exist, it will be created automatically.
Let’s add a System Hybrid Worker to a User Hybrid Worker Group
Log on to the Hybrid Worker.
Open Powershell and set the below location in PowerShell:
Please check the version number. This may differ from the example.
Set-Location -Path 'C:\Program Files\Microsoft Monitoring Agent\Agent\AzureAutomation\7.3.1125.0\HybridRegistration\'
Import the module in this folder:
Before we continue with the below step, go to the Azure Portal and open the appropriate Azure Automation environment and go to the Keys tab.
Copy the Primary Access Key and URL into this piece of code & name the GroupName as you want.
Add-HybridRunbookWorker -GroupName 'Test' -Key XXXXXXX -Url XXXXXXX
The code you used should look like this:
Set-Location -Path 'C:\Program Files\Microsoft Monitoring Agent\Agent\AzureAutomation\7.3.1125.0\HybridRegistration\' Import-Module .\HybridRegistration.psd1 Add-HybridRunbookWorker -GroupName 'Test' -Key XXXXXXX -Url XXXXXXX
And your PowerShell console Output this:
You will now see a User Hybrid Worker Group in Azure Automation:
And you can now start a Runbook on the Hybrid Worker Group: