Forum Discussion
Using SharePoint Webhooks with Azure functions concurrency
I have worked out how to setup my SharePoint Webhook to post to an Azure Function. The function drops an entry in a queue and that triggers another function. I am storing the last change value in a blob and calling a ChangeQuery against the SharePoint library to get the documents that need to be processed.
My question is that using this approach, if multiple changes happen in the library in quick succession, the webhook fires multiple times and then the same items can be returned to multiple instances of the second function. I want to avoid processing a change more than once.
What approach is recommended to avoid the multiple processing?
Thanks
Hi,
If you go to your function app settings, you should be able to edit the host.json file at the bottom. To reduce the number of runs you can make use of the following code:
{ "queues": { "maxPollingInterval": 2000, "visibilityTimeout": "00:00:30", "batchSize": 1, "maxDequeueCount": 5 }, "http": { "routePrefix": "api", "maxOutstandingRequests": 20, "maxConcurrentRequests": 1, "dynamicThrottlesEnabled": false } }Cheers
Bernd
1 Reply
- Bernd VerhofstadtIron Contributor
Hi,
If you go to your function app settings, you should be able to edit the host.json file at the bottom. To reduce the number of runs you can make use of the following code:
{ "queues": { "maxPollingInterval": 2000, "visibilityTimeout": "00:00:30", "batchSize": 1, "maxDequeueCount": 5 }, "http": { "routePrefix": "api", "maxOutstandingRequests": 20, "maxConcurrentRequests": 1, "dynamicThrottlesEnabled": false } }Cheers
Bernd