Nick Eales’ blog

Hoping to save someone some time (including myself)

Recently I was exploring the use of webhooks & needed to troubleshoot the parameters being passed to a webhook.

This is the Azure Automation PowerShell runbook that I used to display what was being passed to the webhook:

param (
    [object]$WebhookData
)

# If runbook was called from Webhook, WebhookData will not be null.
if ($WebhookData -ne $null) {
        $webhookbody = convertfrom-json $webhookdata.RequestBody
        $webhookbody.context.timestamp | write-output
        $webhookbody.context.event.OperationName | write-output
        $webhookbody.context.resourceId | write-output
        $webhookbody.context | write-output
        $webhookbody | write-output
}

As usual for any of my blog posts – if you have any feedback about any of the above, please provide it – that’s how I learn.

Back