azure - Azure Blob 存储功能的并发问题

标签 azure c#-4.0 azure-blob-storage dynamics-crm-online

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.

enter image description here

所以您可以关注host.json的内容创建如下模板文件,将 queues.batchSize 值设置为 1,以限制带有 Blob 触发器的 Azure Functions 每次处理一个文件。

enter image description here

作为引用,有两个类似的 SO 线程您也可以引用。

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

关于azure - Azure Blob 存储功能的并发问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57766154/

相关文章:

c# - 如何在 C# 中声明一个 void 指针

.net - 分支中的 Azure .yaml 管道文件策略

c# - await 和 async 与 Task 并行库的区别

regex - 如何从azure数据流中的字符串列中提取dd-mm-yyyy格式的数据?

sql-server-2008 - ADO.Net:重用打开的 SqlConnection 还是每次都获取一个新的?

.net - Azure Blob 存储的逻辑应用触发器不起作用

node.js - 从azure blob下载excel文件并处理其数据,无需将文件保存到本地目录

visual-studio - 如何使用 Visual Code studio 在 azure 上部署静态网站?

azure - cosmosdb/documentdb 中的多主机

azure - Azure 云服务器 2019 上出现 "The RPC server is unavailable"错误