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
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
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"
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.