question

ZarekHarbour-1509 avatar image
0 Votes"
ZarekHarbour-1509 asked vipullag-MSFT edited

Install and use Hybrid Worker extension using REST API Issues

I followed this documentation and successfully provisioned all of the expected resources, but am running into an issue:
https://docs.microsoft.com/en-us/azure/automation/extension-based-hybrid-runbook-worker-install?tabs=windows#install-and-use-hybrid-worker-extension-using-rest-api

The hybrid worker group is reporting that the "Hybrid Worker Extension not installed on this machine". Here are the steps I have taken and each relevant API response. Assume the automation account, hybrid worker group, and virtual machine have already been created for this example. Sensitive values have been removed.

The API response when connecting a VM to the hybrid worker group

 {
       "id": "/subscriptions/(subscriptionID)/resourceGroups/bia-ca-subs-sbx/providers/Microsoft.Automation/automationAccounts/bia-ca-subs-sbx-aa/hybridRunbookWorkerGroups/testGroup/hybridRunbookWorkers/634b64e7-b112-478c-8480-7bef152f49d3",
       "name": "634b64e7-b112-478c-8480-7bef152f49d3",
       "properties": {
         "ip": "",
         "lastSeenDateTime": "0001-01-01T00:00:00+00:00",
         "registeredDateTime": "2022-05-13T17:05:20.0766666+00:00",
         "vmResourceId": "/subscriptions/(subscriptionID)/resourceGroups/bia-ca-subs-sbx/providers/Microsoft.Compute/virtualMachines/casbxhybridvm",
         "workerName": "casbxhybridvm",
         "workerType": "HybridV2"
       },
       "systemData": {
         "createdAt": "2022-05-13T17:05:20.0766666+00:00",
         "lastModifiedAt": "2022-05-13T17:05:20.0766666+00:00"
       },
       "type": "Microsoft.Automation/AutomationAccounts/HybridRunbookWorkerGroups/HybridRunbookWorkers"
     }

We can see the VM has been added
201873-screenshot-2022-05-13-131548.png

Grab the AutomationHybridServiceUrl

 az rest --method get --uri "/subscriptions/${subscriptionId}/resourceGroups/${resourceGroup}/providers/Microsoft.Automation/automationAccounts/${automationAccount}?api-version=2021-06-22" | jq .properties.automationHybridServiceUrl -r

The API response when Installing the Hybrid Worker Extension on Azure VM

 {
   "id": "/subscriptions/(subscriptionID)/resourceGroups/bia-ca-subs-sbx/providers/Microsoft.Compute/virtualMachines/casbxhybridvm/extensions/HybridWorker",
   "location": "eastus2",
   "name": "HybridWorker",
   "properties": {
     "autoUpgradeMinorVersion": false,
     "provisioningState": "Creating",
     "publisher": "Microsoft.Azure.Automation.HybridWorker",
     "settings": {
       "AutomationAccountURL": "https://6016f50b-c692-419d-a35b-4a29e77a62e8.jrds.eus2.azure-automation.net/automationAccounts/6016f50b-c692-419d-a35b-4a29e77a62e8"
     },
     "type": "HybridWorkerForWindows",
     "typeHandlerVersion": "0.1"
   },
   "type": "Microsoft.Compute/virtualMachines/extensions"
 }

We can see the VM extension has been installed and provisioned
201790-screenshot-2022-05-13-132724.png

Now when I go to verify the hybrid worker group node can see the newly installed extension, I find the error "Hybrid Worker Extension not installed on this machine"
201760-screenshot-2022-05-13-132826.png

If I connect the VM to the hybrid worker group via the portal this is not an issue. The extension is installed automatically and the worker group and VM extension have no issues communicating. Any help would be appreciated.

azure-automation
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@ZarekHarbour-1509 Welcome to Microsoft Q&A Community Forum and thanks for your query. Can you please provide me the operating system on which you are installing this extension?

0 Votes 0 ·

The OS is Windows (Windows Server 2019 Datacenter). I spent some time poking around the machine in question. The Hybrid Worker Extension service does appear to be running despite the error. I've pulled the troubleshooting script output for this thread. There is some kind of disconnect between the hybrid worker group and the VM. The hybrid worker group is still reporting the VM as "Hybrid Worker Extension not installed on this machine".

202326-troubleshoot.txt


0 Votes 0 ·
troubleshoot.txt (7.3 KiB)

0 Answers