Remote event receiver working well when debug locally, but did not work after publishing it to azure

%3CLINGO-SUB%20id%3D%22lingo-sub-1148121%22%20slang%3D%22en-US%22%3ERemote%20event%20receiver%20working%20well%20when%20debug%20locally%2C%20but%20did%20not%20work%20after%20publishing%20it%20to%20azure%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1148121%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20developed%20a%20remote%20event%20receiver%20for%20our%20classic%20online%20team%20site.%20the%20RER%20worked%20well%20when%20i%20debug%20it%20locally%2C%20bu%20after%20publishing%20it%20to%20azure%20the%20RER%20is%20not%20having%20any%20effect.%20here%20are%20the%20steps%20i%20followed%20to%20deploy%20them%20to%20azure%3A-%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E1.%26nbsp%3Bi%20generate%20the%20client%20and%20secret%20id%2C%20using%20this%20url%20inside%20our%20classic%20team%20site%20%3CA%20href%3D%22https%3A%2F%2F****.sharepoint.com%2F_layouts%2F15%2Fappregnew.aspx%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2F****.sharepoint.com%2F_layouts%2F15%2Fappregnew.aspx%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E2.%20then%20i%20access%20the%20app%20from%20the%20SP%20admin%20center%20%40%20%3CA%20href%3D%22https%3A%2F%2F***-admin.sharepoint.com%2F_layouts%2F15%2Fappinv.aspx%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2F***-admin.sharepoint.com%2F_layouts%2F15%2Fappinv.aspx%3C%2FA%3E%20and%20i%20grant%20the%20app%20the%20following%20xml%20permission%3A-%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%3CAPPPERMISSIONREQUESTS%20allowapponlypolicy%3D%22true%22%3E%0A%3CAPPPERMISSIONREQUEST%20scope%3D%22http%3A%2F%2Fsharepoint%2Fcontent%2Ftenant%22%20right%3D%22FullControl%22%3E%3C%2FAPPPERMISSIONREQUEST%3E%0A%3C%2FAPPPERMISSIONREQUESTS%3E%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E3.%20I%20create%20a%20new%20App%20Service%20inside%20azure%3C%2FP%3E%3CP%3E4.%20i%20got%20the%20public%20profile%20for%20the%20app%20service%20%26gt%3B%26gt%3B%20using%20VS%202019%20%26gt%3B%26gt%3B%20i%20update%20the%20web.config%20with%20the%20generate%20client%20and%20client%20secret%20(generated%20from%20step%20number-1)%26gt%3B%26gt%3Bi%20publish%20it%20using%20the%20ftp%3A-%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20701px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F168601i2C75734A50B2AD32%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22validate.png%22%20title%3D%22validate.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E5.%26nbsp%3B%20now%20i%20can%20access%20the%20app%20service%20%2B%20the%20.svc%20service%2C%20here%20is%20the%20result%20i%20got%20when%20i%20access%20the%20service%20(rer.svc%20in%20my%20case)%3A-%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F168602i7B58C512AA4EA908%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%223QTKl.png%22%20title%3D%223QTKl.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E6.%20then%20i%20used%20this%20PnP%20script%20to%20add%20the%20RER%20and%20link%20it%20to%20the%20list%3A-%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CU%3EAdd-PnPEventReceiver%20-List%20%22Project%20System%22%20-Name%20%22PUSRERupdating%22%20-Url%20%3CA%20href%3D%22https%3A%2F%2Ftgrouppusrer.azurewebsites.net%2Frer.svc%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Ftgrouppusrer.azurewebsites.net%2Frer.svc%3C%2FA%3E%20-EventReceiverType%20ItemUpdating%20-Synchronization%20Synchronous%3C%2FU%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CU%3EAdd-PnPEventReceiver%20-List%20%22Project%20System%22%20-Name%20%22PUSRERupdated%22%20-Url%20%3CA%20href%3D%22https%3A%2F%2Ftgrouppusrer.azurewebsites.net%2Frer.svc%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Ftgrouppusrer.azurewebsites.net%2Frer.svc%3C%2FA%3E%20-EventReceiverType%20ItemUpdated%20-Synchronization%20Asynchronous%3C%2FU%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ebut%20when%20i%20update%20any%20item%20inside%20the%20Project%20system%20list%2C%20i%20will%20not%20get%20any%20effect.%20final%20not%20i%20am%20following%20the%20approach%20mentioned%20in%20this%20link%20%40%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fderekgusoff.wordpress.com%2F2017%2F11%2F08%2Fremote-event-receivers-youre-all-doing-it-wrong%2F%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fderekgusoff.wordpress.com%2F2017%2F11%2F08%2Fremote-event-receivers-youre-all-doing-it-wrong%2F%3C%2FA%3E%26nbsp%3B%20to%20create%20and%20deploy%20the%20RER%2C%20which%20again%20worked%20well%20when%20i%20debug%20it%20locally.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1148121%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAPIs%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExtensibility%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPnP%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Valued Contributor

I have developed a remote event receiver for our classic online team site. the RER worked well when i debug it locally, bu after publishing it to azure the RER is not having any effect. here are the steps i followed to deploy them to azure:-

 

1. i generate the client and secret id, using this url inside our classic team site https://****.sharepoint.com/_layouts/15/appregnew.aspx 

2. then i access the app from the SP admin center @ https://***-admin.sharepoint.com/_layouts/15/appinv.aspx and i grant the app the following xml permission:-

 

 

<AppPermissionRequests AllowAppOnlyPolicy="true">
<AppPermissionRequest Scope="http://sharepoint/content/tenant" Right="FullControl" />
</AppPermissionRequests>

 

 

3. I create a new App Service inside azure

4. i got the public profile for the app service >> using VS 2019 >> i update the web.config with the generate client and client secret (generated from step number-1)>>i publish it using the ftp:-

validate.png

5.  now i can access the app service + the .svc service, here is the result i got when i access the service (rer.svc in my case):-

3QTKl.png

6. then i used this PnP script to add the RER and link it to the list:-

 

 

Add-PnPEventReceiver -List "Project System" -Name "PUSRERupdating" -Url https://tgrouppusrer.azurewebsites.net/rer.svc -EventReceiverType ItemUpdating -Synchronization Synchronous

Add-PnPEventReceiver -List "Project System" -Name "PUSRERupdated" -Url https://tgrouppusrer.azurewebsites.net/rer.svc -EventReceiverType ItemUpdated -Synchronization Asynchronous

 

but when i update any item inside the Project system list, i will not get any effect. final not i am following the approach mentioned in this link @ https://derekgusoff.wordpress.com/2017/11/08/remote-event-receivers-youre-all-doing-it-wrong/  to create and deploy the RER, which again worked well when i debug it locally.

0 Replies