question

AyeshaIqbal-4440 avatar image
0 Votes"
AyeshaIqbal-4440 asked AyeshaIqbal-4440 commented

SharePoint Online Remote Event Receiver added from an Azure function App does not fire

Hello,

I have a project which requires adding remote event receivers to SharePoint Online Lists from an Azure function app. I am able to add the RER but it never fires.
It is being added under the App's context and the App has the required permissions to the tenant of course. The RER shows as added with the right endpoint (this is a function url ). The function url is never being hit when an Item is added to the list or updated. And absolutely no logs which mentions any error.

Has anyone ever had a similar situation and knows anything about the issue? Please help.

Thanks
Ayesha

office-sharepoint-onlineazure-functions
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

This seems to be related: https://github.com/SharePoint/sp-dev-docs/issues/4381

When installing RERs via an App which exists on AzureAD only and not in the SP, even receivers don't get triggered.

0 Votes 0 ·
ShaiPetel-0392 avatar image
0 Votes"
ShaiPetel-0392 answered AyeshaIqbal-4440 commented

Any update or news on this? From what I can tell RER are not working for Azure AD registered apps, and Microsoft aren't planning on fixing this.

Did you get have any luck with this, I want to avoid wasting time on another support ticket?

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

The support tickets kept going in a loop to different teams and in the end was asked to put the question in the Microsoft Tech Community. No luck there as well. It doesn't look like there is any fix for this.
I have changed the approach and used webhooks instead.

Regards
Ayesha

1 Vote 1 ·

I can't use webhooks since they do not support sync events that can validate/cancel and update.

However I found a manual fix:

  1. Visit https://[tenant]-admin.sharepoint.com/_layouts/15/appinv.aspx

  2. Fill in your azure application ID in "app ID" and click to load info

  3. In my case - I had to fill in the domain, and permissions (XML below)

  4. Grant access

Once I've done that, I could register RER and they fired correctly.
I'm not sure yet, but I think you will have to remove and register them AFTER you done these steps.

The XML I used to grant full trust permissions on the tenant level:


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

0 Votes 0 ·

Thank you.

Unfortunately adding app details into tenant and giving tenant wide permissions is not an option for my project. But hopefully that helps someone.

Thanks again.

Regards
Ayesha

0 Votes 0 ·
Jerryzy avatar image
0 Votes"
Jerryzy answered AyeshaIqbal-4440 commented

Hi @Ayeshalqbal-4440,

I tested to host the ItemAdded Event Receiver with Provider Hosted Add in and publish to a Azure App Service in Visual Studio and install the add in in the site, the Remote Event Receiver is added to the specific list verified using this script:


 #region Variables 
    
 $Username = "admin@tenant.onmicrosoft.com" 
    
 $Password = "password" 
    
 $siteURL = "https://tenant.sharepoint.com/yoursite" 
    
 #endregion Variables
    
 #region Credentials 
    
 [SecureString]$SecurePass = ConvertTo-SecureString $Password -AsPlainText -Force 
    
 [System.Management.Automation.PSCredential]$PSCredentials = New-Object System.Management.Automation.PSCredential($Username, $SecurePass) 
    
 #endregion Credentials
    
 Connect-PnPOnline -Url $siteURL -Credentials $PSCredentials
    
 Get-PnPEventReceiver -List "LibraryTitle" |ft ReceiverId,ReceiverName, ReceiverUrl,EventType,Synchronization
    
 Write-Host '--------'

54861-snipaste-2021-01-08-16-30-37.png

And Attach Debugger in Visual Studio like this:

54724-snipaste-2021-01-08-16-31-34.png

Same issue in my side, the event didn't trigger even though the svc and event is valid for the list.

I suggest you can open a Support Ticket to contact the Support Engineer for deep troubleshooting, there is some log can be found for the site with the help of them and help to find the error message more easily.



Thanks
Best Regards


If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello @Jerryzy-MSFT ,

Thank you for your response. I have raised a support ticket with Microsoft. :)

Regards

0 Votes 0 ·
PramodValavala-MSFT avatar image
0 Votes"
PramodValavala-MSFT answered AyeshaIqbal-4440 commented

I'm unfamiliar with Remove Event Receivers in Sharepoint, but I believe WebHooks are simpler to configure and there is a doc to set one up using Azure Functions in the docs as well.


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @PramodValavala-MSFT ,

Thank you. I have been looking at webhooks as an alternative. But very much interested in the issue with RER as well.

Much Appreciated. :)

0 Votes 0 ·