我正在使用 azure 功能的应用程序服务计划,并添加了 blob 触发器,但是当任何文件上传到 blob 容器时,功能不会触发。或者有时它花费了太多时间,然后在它开始触发。 任何建议将不胜感激
当新文件上传到 blob 容器时,它应该触发该函数。
最佳答案
这应该是冷启动的情况
根据此处的注释
When you're using a blob trigger on a Consumption plan, there can be up to a 10-minute delay in processing new blobs. This delay occurs when a function app has gone idle. After the function app is running, blobs are processed immediately. To avoid this cold-start delay, use an App Service plan with Always On enabled, or use the Event Grid trigger.
对于您的情况,您需要考虑事件网格触发器而不是 blob 触发器,事件触发器也具有对 blob 事件的内置支持。
关于Azure Blob 触发器有时需要花费太多时间才能触发,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55759390/