I am trying to read the URL query params from a POST coming into my Azure webhook (PowerShell).
My webhook is receiving a POST request such as:
Content-Type: text/plain; charset=utf-8
POST https://{notificationUrl}?validationToken={opaqueTokenCreatedByMicrosoftGraph}
As you may tease out, the context here is the creation of a Microsoft Graph subscription. However, I don't want to muddy up this post with too many details because I think my question is general enough: how to read POST params in an Azure webhook.
The runbook attached to this webhook (based on this one) apparently requires all the client data to come in via a single parameter called WebhookData. I am able to read the WebhookName, RequestBody, and RequestHeader inside WebhookData. However, I don't know how to read the URL query parameter in the POST request that is reaching my webhook.
Specifically, I need to access that validationToken. It doesn't show up in the WebhookData. I've also tried removing the Webhookdata param altogether from my runbook, but then absolutely nothing comes in. I've also tried adding a validationToken param, alongside the WebhookData param, but validationToken comes out empty.
I should add that, along with the POST from Graph (which doesn't work), I am testing my runbook with Postman and making sure to include a validationToken in the URL. Again, I can read it if I include it in the POST body, but not if it's a query param. And since ultimately Graph will be sending it via the query param, I think I have to get that to work first.
