powershell: [BUG] RemoteEventReceivers are not fired when added via PnP.Powershell
When I add an Remote EventReceiver using PnP.Powershell, it simply doesnt get fired.
I used command:
Add-PnPEventReceiver -List Seiten -Name LeoRecTest3 -Url "https://<myOwnSink>.m.pipedream.net/test2.svc" -EventReceiverType ItemUpdated -Synchronization DefaultSynchronization -SequenceNumber 5
This is using pipedram as Sink, but it didn´t work with other sinks as well.
However, uninstalling PnP.Powershell and adding the Eventreceiver (with the same command and same list) and the events are fired. Furthermore, i found out, that i was not able to remove the RER using PnP.Powershell, when it was added via SharepointPnPPowershellOnline. I then get the error that I am not authorized to do so.
Interestingly, the EventReceiver shows up correctly when inspecting the EventReceivers in the List, i was not able to detect any difference between added via PnP.Powershell and SharePointPnPPowerShellOnline. Just one worked while the other didn´t.
Expected behavior
RER is fired, also when added via PnP.Powershell and RER added via SharePointPnPPowerShellOnline can be deleted using PnP.PowerShell
Actual behavior
RER added via PnP.Powershell are not fired. cannot delete RemoteEventReceivers added formerly by using SharePointPnPPowerShellOnline
Steps to reproduce behavior
Add an RemoteEventreceiver via PnP.Powershell and target it to an http-sink like requestbin, hookb.in, pipedream or similar. No request will be received. Added the RemoteEventreceiver via SharePointPnPPowerShellOnline and the request will be received
What is the version of the Cmdlet module you are running?
1.4
Which operating system/environment are you running PnP PowerShell on?
- [ x] Windows
- Linux
- MacOS
- Azure Cloud Shell
- Azure Functions
- Other : please specify
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 34 (7 by maintainers)
No, there is no workaround. According to MS RemoteEventReceiver are meant to work within an Sharepoint-Registered App. So, whenever you send an token for authorization with your request, it thinks it is an token for a Sharepoint-Registered-App. However, when that token is a token for an AzureAD-registered-App, this results in a fail cause it will not find an Sharepoint-Registered App. It works only when not using an token at all, which means, you have to be authorized via ClientCredentials/cookie-based Authentication. This is by design and it was even an undocumented and therefore not supported feature that it even worked with cookie-based-Authentication in the past. So, for MS, this is working as designed and “No Issue”.
However, when closing that issue, they meant, that I am the first and yet only one having a problem with it. So you are free to make an issue with MS too. Maybe more complaints may force them to do something about it.
The only workaround is to use legacy-Authentication in the Powershell-7 Version or stick with the old Version in Powershell 5.
@LeopoldLerch , you are not the first 😃 they say that to everyone. I opened a similar ticket with Microsoft in February, and they said I was the first.