Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Remote Event Receiver is not called when created with Add-PnPEventReceiver #3169

Closed
1 of 6 tasks
nils-a opened this issue Jun 8, 2023 · 2 comments
Closed
1 of 6 tasks
Labels
bug Something isn't working

Comments

@nils-a
Copy link

nils-a commented Jun 8, 2023

Reporting an Issue or Missing Feature

Remote Event Receiver web service is not called when created with Add-PnPEventReceiver and the event is happening.

Expected behavior

RER should call it's external url web service

Actual behavior

Nothing happens. It seems RER are simply not working, when they are added via Add-PnPEventReceiver

Steps to reproduce behavior

  • create a simple endpoint
  • publish via ngrok to have a public url
  • Add-PnPEventReceiver -List [List] -Url [endpoint] -EventReceiverType ItemAdded -Synchronization Asynchronous -Name [Some Name]
  • Add an item to the list

What is the version of the Cmdlet module you are running?

2.1.1

Which operating system/environment are you running PnP PowerShell on?

  • Windows
  • Linux
  • MacOS
  • Azure Cloud Shell
  • Azure Functions
  • Other : please specify

Additional information

#581 and #464 reported the same problem. Both have been closed without any solution.
I suggest that Add-PnPEventReceiver at least write out some warning that success of that operation is rather unlikely, to spare others from searching days long on what the problem might be.

@nils-a nils-a added the bug Something isn't working label Jun 8, 2023
@Tanddant
Copy link
Contributor

Tanddant commented Jun 8, 2023

The issue is that this has nothing to do with PnP PowerShell - adding a remote event receiver with CSOM doesn't work either when you're connected with an app registration.

ReRs are tied to a user Id (if you add a ReR with UseWebLogin it will work, but the second that user is closed the ReR stops firering.

What you can to is to connect using an App registration that you own, and register as an ACS app on the https://{tenant}-admin.sharepoint.com/_layouts/15/appinv.aspx page with the following permissions

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

Connect with PowerShell and that app, and you're off to the races.

This is super annoying, but it's simply due to Microsoft not updating ReRs anymore (they've been stated as being a legacy technology several times unfortunately)

@gautamdsheth
Copy link
Collaborator

Thanks @Tanddant , not much we can do from PnP PowerShell side of things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants