New-AzureRmAutomationWebHook: add support for RunOn
Please add a -RunOn parameter to New-AzureRmAutomationWebHook and Set-AzureRmAutomationWebHook similar to Start-AzureRmAutomationRunbook
New-AzureRmAutomationWebHook -ResourceGroupName resourcegroup -AutomationAccountName autoaccount -Name webhook -RunbookName runbook -IsEnabled $true -ExpiryTime ((Get-Date).AddYears(1)) -RunOn worker
Until that is added, is there any good workaround for scripting out creation of a runbook webhook for a hybrid worker?
Thanks!
I did manage to find a work-around in the short-term. You can create the webhook with New-AzureRmAutomationWebhook and then update just the runOn property with Set-AzureRmResource
$webhook = New-AzureRmAutomationWebhook -Name $WebhookName `
-RunbookName $RunbookName `
-ResourceGroupName $ResourceGroupName `
-AutomationAccountName $AutomationAccountName `
-IsEnabled $true `
-ExpiryTime (Get-Date).AddYears(1) `
-Force
Write-Host $webhook.WebhookURI
$webhook = Get-AzureRmResource -ResourceGroupName $ResourceGroupName -ResourceType 'Microsoft.Automation/automationAccounts/webhooks' -ResourceName "$AutomationAccountName/$WebhookName"
$webhook.Properties.runOn = $HybridWorkerGroup
Set-AzureRmResource -ResourceId $webhook.ResourceId -Properties $webhook.Properties -ApiVersion '2015-10-31' -Force
@safeermohammed Hey Safeer, would you mind taking a look at this issue?
We have in backlog to add the optional runOn parameter for Webhook. It will be taken up in up coming releases
Support was provided a while back, seems like the issue is not closed