A Microsoft cloud service that enables deployment of Azure services across hybrid and multicloud environments.
How to deploy Arc Extension Microsoft.Azure.Automation.HybridWorker via REST API
Hi, I am trying to deploy an Microsoft.Azure.Automation.HybridWorker via powershell and REST API but it fails with the following error:
{"Message":"Specified machineId is not associated with automation account.
This is the method I am used:
$PutHybridRunbookWorkerUri = "https://management.azure.com/subscriptions/$($SubscriptionId)/resourceGroups/$($resourceGroupName)/providers/Microsoft.HybridCompute/machines/$($machineName)/extensions/HybridWorkerExtension?api-version=2021-05-20"
$RequestBodyHybridRunbookWorker = @{
"location" = $($location)
"properties" = @{
"publisher" = "Microsoft.Azure.Automation.HybridWorker"
"type" = "HybridWorkerForWindows"
"typeHandlerVersion" = "0.1.0.18"
"autoUpgradeMinorVersion" = $false
"enableAutomaticUpgrade" = $false
"settings" = @{
"AutomationAccountURL" = $AutomationAccountUrl
}
"protectedSettings" = @{
"primaryaccesskey" = $AutomationAccountKey
}
}
} | ConvertTo-Json -depth 3
Invoke-RestMethod -Headers @{Authorization = "Bearer $token" } -Body $RequestBodyHybridRunbookWorker -Uri $PutHybridRunbookWorkerUri -Method put -ContentType "application/json"
Any ideas?
Kind regards,
Peter Smit
Azure Arc
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
Windows for business | Windows Server | User experience | PowerShell
1 answer
Sort by: Most helpful
-
Deleted
This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.
Comments have been turned off. Learn more