Azure 函数正在同时处理 Blob 存储中的多个文件。 这会导致动态 CRM 中创建重复数据,因为 azure 函数正在并行执行处理多个文件。有人可以帮我吗,我如何限制 azure 函数一次处理一个文件?
最佳答案
根据Trigger - concurrency and memory usage
部分官方文档Azure Functions的Azure Blob存储绑定(bind)
,如下图。
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.
所以您可以关注host.json
的内容创建如下模板文件,将 queues.batchSize
值设置为 1
,以限制带有 Blob 触发器的 Azure Functions 每次处理一个文件。
作为引用,有两个类似的 SO 线程您也可以引用。
关于azure - Azure Blob 存储功能的并发问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57766154/