简体   繁体   中英

Concurrency problem with Azure Blob Storage function

Azure function is processing multiple files in blob storage at same time. This is causing duplicate data creation in dynamics CRM because azure function is processing multiple file in parallel execution. Can someone help me , how i can restrict azure function to process one file at a time?

According to the section Trigger - concurrency and memory usage of the offical document Azure Blob storage bindings for Azure Functions , as the figure below.

The blob trigger uses a queue internally, so the maximum number of concurrent function invocations is controlled by the queues configuration in host.json. The default settings limit concurrency to 24 invocations. This limit applies separately to each function that uses a blob trigger.

在此处输入图片说明

So you can follow the content of the host.json template file as below to set the queues.batchSize value to 1 to restrict Azure Function with Blob Trigger to process one file per time.

在此处输入图片说明

As references, there are two similar SO threads which you can also refer to.

  1. Azure Functions - Limiting parallel execution
  2. Throttling Azure Storage Queue processing in Azure Function App

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM