We develop a REST MVC Webservice in .net C#, which is able to receive Webhook notifications from our internal SharePoint 2019. It works fine, when I test the application from Visual Studio 2019 with Ngrok but when I publish the service to an IIS web server internally, I still get the following error:
{ "odata.error": { "code": "-1, System.InvalidOperationException", "message": { "lang": "fr-FR", "value": "Failed to validate the notification url ? https://xxxx.xxx.local/api/SPWebhook/HandleSharePointRequest ? " }
When I debug the Endpoint from IISExpress with Ngrok on my computer, everything works perfectly. The validation token is returned and SharePoint add the subscription correctly (based on official doc: https://docs.microsoft.com/en-us/sharepoint/dev/apis/webhooks/get-started-webhooks).
But when I publish this Endpoint to a Web Server IIS in our Private Domain I always received the error above. If I use a Ngrok URL for the notification URL it works but when I use a domain URL servername.domain.local we always get the error.
Does the endpoint URL have to be public, even for SharePoint On Premise ? It seems surprising that for an On Premise version the Endpoint must be public. Is there a way to use a private url for the EndPoint?
Many thanks in advance for your help!
question from:
https://stackoverflow.com/questions/65919717/sharepoint-2019-on-premise-webhooks-subscription-with-a-private-endpoint 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…