-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
Category
- Question
- Typo
- Additional article idea
Question
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!
Environment details (development & target environment)
development OS: Windows 10
OS: Windows Server 2019, with IIS
Target Environment: SharePoint 2019 On Premise on Windows Server 2019
Framework: NET Framework v4.5.2
Tooling: Visual Studio 2019