0

I have an Azure powershell runbook, created a webhook for it and I would like to trigger this from SharePoint. When I try to add the webhook subscription, I get this error message.

Add-PnPWebhookSubscription : {"odata.error":{"code":"-1, System.InvalidOperationException","message":{"lang":"en-US","value":"Failed to 
validate the notification URL 'https://xxx.webhook.we.azure-automation.net/webhooks?token=zzzz'."}}}

According to my research, this is because the webhook has to return a validation token. Also, this seems to be passed in the URL of the validation request towards the webhook.

How can I extract this? I have access to the WebhookData input, but it doesn't contain such a property. I added a validationtoken parameter, but that is empty.

1 Answer 1

0

Before a new subscription is created, SharePoint sends a request with a validation token in the body of the request to the service URL provided. Your service must respond to this request by returning the validation token.

If your service fails to validate the request in this way, the subscription is not created.

Here is the document for more details

https://docs.microsoft.com/en-us/sharepoint/dev/apis/webhooks/lists/create-subscription#url-validation

1
  • This part I know and mentioned in the post too. The question is how to achieve this with a webhook of an Azure PowerShell Runbook.
    – vilmarci
    Commented Oct 21, 2022 at 7:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.