Webhook payload runon Azure vs Hybrid worker

Ronald Foppen 0 Reputation points
2024-07-12T11:44:42.3633333+00:00

I am working with azure automation, triggered by webhooks.

Typically this runs directly on Azure and works fine, the webhook data payload is received and handled as a PSCustomObject.

I now need to run the same on a Hybrid Worker because of a OnPrem requirement. When updating the webhook to run on a HW, and sending exactly the same payload, the web hook data is treated as a System.String.

This is obviously causing some challenges; I could look at parsing the string into individual elements again, but that is a PITA.

Any thoughts on why there is a difference on how the webhook data is treated? Or better, how to resolve it.

I've used the very simple example here: https://learn.microsoft.com/en-us/azure/automation/automation-webhooks?tabs=portal#use-a-webhook

Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,187 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Stanislav Zhelyazkov 22,101 Reputation points MVP
    2024-07-15T05:36:57.79+00:00

    Hi,

    I do not know why is different as I haven't used hybrid workers but the easiest way to solve it is to treat the input as json and convert it to PSObject (ConvertFrom-Json). In fact the example does that for the request body.

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.