共用方式為


Install Azure Automation Hybrid Worker Role

Goodbye Orchestrator! Welcome to Azure Automation (AA) and it’s awesome new authoring and runtime components. The Hybrid Worker role now allows you to store your Runbooks in the cloud but execute them in your on-premise environment. Coupled with the new graphical authoring this is the future of automation.

So how do I set it up? Pretty much follow the instructions on the preview portal – but included below are the screenshots of how my environment is configured. Following the instructions which appear when you click the hybrid worker: -

image

Operational Insights needs to be configured as it will monitor the worker role. You can sign up for the preview and create an account. I can’t find the account settings in the preview portal so I have configured it in the old portal.

image

When I click on the account I have a link to the Op Insights dashboard.

image

In my portal I click on the Solutions Gallery and add the Automation feature. It needs to be configured to monitor your AA account.

image

Now we can install the hybrid worker – the instructions are at https://azure.microsoft.com/en-us/documentation/articles/automation-hybrid-runbook-worker/ but I have put them below as well.

First I install the Microsoft Monitoring Agent and configure it to talk to my Operational Insights subscription. The agent is at https://www.microsoft.com/en-au/download/details.aspx?id=40316 . Click next and I agree to agree to the license statement and select a location for the agent.

When the screen below appears –configure the agent to talk to Operational Insights.

image

The workspace key and ID are found on the Operations Insights page – under Overview –> Settings –> Connected sources. Copy and past the keys into the agent installer fields.

image

image

Finish the wizard and the agent will connect to Op Insights. When complete the new agent will appear in the console.

image

So now we can do the Azure Automation steps. In order to confirm that the required pack has been downloaded you can check under C:\Program Files\Microsoft Monitoring Agent\Agent\AzureAutomationFiles – there should be two folders there.

Open up PowerShell and change to the Hybrid Registration folder.

image

Import the psd1 file in the folder by using Import-Module HybridRegistration.psd1 . The new command available are listed below: -

image

The Add-HybridRunbookworker cmdlet needs an endpoint, token, and name – the endpoint and token are found on the Azure Automation page under keys.

image

image

Use the URL information in the Endpoint parameter and the Primary access key in the token parameter. The name parameter allows you to group multiple workers into a collection. If the name exists it will add a worker to the group – otherwise a new group will be created.

image

Once the Cmdlet has run the new group will appear and show the registered workers.

image

I can now write a quick Runbook in the new portal and run it against my hybrid worker. Unfortunately at the moment you can’t test against a hybrid worker.

image

image

image

Waiting for Output….

image

On the Runbook worker I can see the new process start: – Orchestrator.Sandbox

image

And a short time later the results appear in my output pane in Azure.

image