Remote Event Receiver won't fire on SharePoint Online when provisioned externally via a console app

%3CLINGO-SUB%20id%3D%22lingo-sub-106809%22%20slang%3D%22en-US%22%3ERemote%20Event%20Receiver%20won't%20fire%20on%20SharePoint%20Online%20when%20provisioned%20externally%20via%20a%20console%20app%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-106809%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20deployed%20a%20remote%20event%20receiver%20to%20SharePoint%20Online.%20I%20used%20a%20Povider%20Hosted%20App%20hosted%20in%20Azure%20and%20it%20fires%20when%20a%20new%20item%20is%20added%20to%20a%20document%20library.%20This%20all%20works%20perfectly.%20But%2C%20when%20I%20try%20to%20do%20the%20same%20thing%20from%20a%20console%20app%20it%20doesn't%20work%20-%20I%20have%20copied%20the%20code%20that%20attaches%20the%20ItemAdded%20event%20into%20my%20console%20app%20and%20run%20it%20there.%20It%20all%20appears%20to%20work%20and%20if%20I%20examine%20the%20event%20receivers%20on%20the%20lists%20everything%20looks%20correct%2C%20but%20the%20event%20won't%20fire%20where%20it%20was%20attched%20using%20the%20console%20app.%3C%2FP%3E%3CP%3EJust%20to%20clarify%2C%20I%20use%20the%20same%20code%20in%26nbsp%3Bmy%20app's%26nbsp%3BAppInstalled%20event%20and%20in%20my%20console%20app%20and%20they%20both%20add%20the%20event%20receiver%20correctly.%20But%20the%20events%20only%20fire%20where%20they%20were%20added%20via%20AppInstalled%20and%20not%20via%20the%20console.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-106809%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-106822%22%20slang%3D%22en-US%22%3ERe%3A%20Remote%20Event%20Receiver%20won't%20fire%20on%20SharePoint%20Online%20when%20provisioned%20externally%20via%20a%20console%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-106822%22%20slang%3D%22en-US%22%3E%3CP%3EI've%20just%20noticed%20that%20when%20I%20remove%20my%20app%20my%20AppUnisntalling%20event%20deletes%20all%20the%20event%20receivers%20from%20all%20lists%20and%20succeeds%20except%20where%20events%20have%20bee%20added%20via%20the%20console%20app%20and%20reports%20it%20does%20not%20have%20permission.%20The%20plot%20thickens.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1596776%22%20slang%3D%22en-US%22%3ERe%3A%20Remote%20Event%20Receiver%20won't%20fire%20on%20SharePoint%20Online%20when%20provisioned%20externally%20via%20a%20console%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1596776%22%20slang%3D%22en-US%22%3EHi%20Martin%2C%20did%20you%20ever%20resolve%20this%3C%2FLINGO-BODY%3E
New Contributor

I have deployed a remote event receiver to SharePoint Online. I used a Povider Hosted App hosted in Azure and it fires when a new item is added to a document library. This all works perfectly. But, when I try to do the same thing from a console app it doesn't work - I have copied the code that attaches the ItemAdded event into my console app and run it there. It all appears to work and if I examine the event receivers on the lists everything looks correct, but the event won't fire where it was attched using the console app.

Just to clarify, I use the same code in my app's AppInstalled event and in my console app and they both add the event receiver correctly. But the events only fire where they were added via AppInstalled and not via the console.

2 Replies

I've just noticed that when I remove my app my AppUnisntalling event deletes all the event receivers from all lists and succeeds except where events have bee added via the console app and reports it does not have permission. The plot thickens.