Skip to main content

I have a webhook runbook set up on a hybrid worker in Azure that is written in PowerShell 5.1. When the runbook is triggered, the webhookdata object that is delivered is null. Below is the simple test script I’ve created as a starting point using an example from Microsoft documentation.

When it runs, the WebHookData object that is delivered by the webhook is null.

 

param (

    Parameter (Mandatory = $false)]

    

    )

if ($WebHookData) {

    write-information $WebHookData

    if (-not $WebHookData.RequestBody) {

        $WebHookData = (Convertfrom-Json -inputobject $WebHookData)

        write-information $WebHookData

        }

    $WebHookData | set-content -path "<some path>" -force

    $VMS = (convertfrom-json -inputobject $WebHookData.RequestBody)

    write-information $VMS

    }

else {

    write-information "WebHookData is null"

    }

 

At one point, I was receiving data, but at some point, it stopped for reason I cannot figure out.

 

 

Join the Community or User Group to Participate in this Discussion

Reply