Skip to main content
Solved

Problems Processing Webhook Data in Azure PowerShell Runbook

  • June 25, 2024
  • 1 reply
  • 111 views

Forum|alt.badge.img+1

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)]

    [object] $WebHookData

    )

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.

 

 

Best answer by mahendarsingh

Hi ​@DougAtBHB ,

Firstly apologize for the delay. I understand that you want to get in touch with the developer community members, Our team is waiting for your comments so please feel free to post. the query on https://community.freshworks.dev/ where our dev community would be able to assist you with solution to your queries. 

Thank you !!

1 reply

mahendarsingh
Community Manager
Forum|alt.badge.img+9
  • Community Manager
  • Answer
  • August 9, 2025

Hi ​@DougAtBHB ,

Firstly apologize for the delay. I understand that you want to get in touch with the developer community members, Our team is waiting for your comments so please feel free to post. the query on https://community.freshworks.dev/ where our dev community would be able to assist you with solution to your queries. 

Thank you !!