I am developing a remote event receiver for our SharePoint online development site. I followed the following steps: –
1- As mentioned in this link https://derekgusoff.wordpress.com/2017/11/08/remote-event-receivers-youre-all-doing-it-wrong/ I created a new asp.net web application within VS 2019 + I add a WFC service.
2- Within the service I added the following test code, to update the article title, as follows: –
public SPRemoteEventResult ProcessEvent(SPRemoteEventProperties properties)
SPRemoteEventResult result = new SPRemoteEventResult();
//if using App Only Context, use this method, and make sure ClientId and ClientSecret are specified in AppSettings
using (ClientContext context = Helpers.GetAppOnlyContext(siteUrl))
result.ChangedItemProperties.Add("Title", "After adding");
result.Status = SPRemoteEventServiceStatus.Continue;
3- I run the ngrok to debug the RER: –
Run ngrok command :- ngrok --http-header=rewrite 53938
4- register the RER within the Dev @ site
5- Update web.config with the generated clientId and clientsecret.
6- I add the RER, using this command:
Add-PnPEventReceiver -List "12" -Name "TasksRER" -Url http://4f9922f3.ngrok.io/service1.svc -EventReceiverType ItemAdding -Synchronization Synchronous
7- I add the application permission using this url
https://***admin.sharepoint.com/_layouts/15/appinv.aspx, as follows: –
8- I execute the VS project and the RER worked well..
9- now I wanted to implement the RER in azure >> so I create a new blue web application >> generate a zip file for the project within VS >> and implement the zip inside the blue web application using drag / drop kudu, and I can access the service within blue as follows: –
10- I re-register the RER using the blue URL instead of the ngrok URL, as follows: –
Remove-PnPEventReceiver -List 12 -Identity TasksRER
Add-PnPEventReceiver -List "12" -Name "TasksRER" -Url https://****.azurewebsites.net/service1.svc -EventReceiverType ItemAdding -Synchronization Synchronous
but when I add a new element, nothing happens, where it seems that the RER was not fired. So, can anyone advise what the problem could be?