question

JAPNAMSINGH-6684 avatar image
0 Votes"
JAPNAMSINGH-6684 asked MichaelHan-MSFT commented

Is there any way to call azure functions from Sharepoint SPItemEventReceiver.ItemAdded Event handler

HI Team,

I was wondering is there any way to call azure function from Sharepoint SPItemEventReceiver.ItemAdded Event handler or any other way to consume azure functions in SharePoint event handler?

office-sharepoint-onlineazure-functions
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.

1 Answer

MikeUrnun avatar image
0 Votes"
MikeUrnun answered MichaelHan-MSFT commented

Hello @JAPNAMSINGH-6684,

I'm not sure of all the features on the Sharepoint side but if it lets you use HttpClient (in the SPItemEventReceiver.ItemAdded event handler) and invoke an HTTP endpoint, you can a corresponding Function App with an HTTP trigger, and the entire thing should work. It seems to have been done before with Sharepoint Online, in example: SharePoint Remote Event Receivers using Azure Function

Another approach is to use Logic Apps workflow and it might be quicker & simpler to manage:

  • Sharepoint Connector has a dozen triggers, one of which is When an item is created.

  • Assuming that the event you want is provided by the SP connector, you can then call your function app using the Azure Functions connector.

I hope this helps you to get started, let me know if you have any further questions.



· 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.

Hi @JAPNAMSINGH-6684 - Just checking in here, were you able to implement this successfully?

1 Vote 1 ·

@MikeUrnun Yes, I was able to use httpClient way to consume azure functions. Thanks for your help

0 Votes 0 ·

@JAPNAMSINGH-6684,

If Mike's answer helps you, you could accept it as answer:)
It would be helpful to others who have similar issues in the future.

0 Votes 0 ·