azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

New-AzureRmAutomationWebHook: add support for RunOn

Open gregjhogan opened this issue 10 years ago • 4 comments

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!

gregjhogan avatar Oct 14 '16 00:10 gregjhogan

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

gregjhogan avatar Oct 14 '16 02:10 gregjhogan

@safeermohammed Hey Safeer, would you mind taking a look at this issue?

cormacpayne avatar Oct 14 '16 23:10 cormacpayne

We have in backlog to add the optional runOn parameter for Webhook. It will be taken up in up coming releases

safeermohammed avatar Oct 17 '16 19:10 safeermohammed

Support was provided a while back, seems like the issue is not closed

safeermohammed avatar Apr 04 '18 22:04 safeermohammed