Azure Blob存储触发器功能未触发 [英] Azure Blob Storage trigger Function not firing

查看:82
本文介绍了Azure Blob存储触发器功能未触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在创建使用App Service计划进行托管的Azure Function Blob触发器模板时,该函数在配置为始终在线"时会正确触发.我已经通过在Azure控制台中运行应用程序并通过Microsoft Azure存储资源管理器添加文件进行了测试.当查看该功能的Monitor屏幕时,可以找到这些触发器的日志.

When creating an Azure Function blob trigger template that uses an App Service plan for hosting, the function triggers correctly when configured as "Always on". I have tested by running the app in the Azure console, and by adding a file though the Microsoft Azure Storage Explorer. The logs of these triggers can be found when viewing the Monitor screen for the function.

使用Blob存储模板创建相同功能时,但是这次选择消费"而不是App Service计划,则监视器下什么也不显示.当我在Azure控制台中运行测试或将文件添加到目标Blob容器时,这些触发日志不会显示在monitor屏幕上.

When creating the same function using the Blob Storage template but this time choosing "Consumption" instead of App Service plan, nothing is displaying under monitor. When I run a test in the Azure console or add a file to the target Blob container, these trigger logs do not display on the monitor screen.

如何将新模板添加到Blob容器中以确保触发此触发模板?

What can be done to ensure that this trigger template is firing when a new file is added to the Blob container?

推荐答案

Mohit提供的解释是正确的,但是我想在测试后添加一些有关它的信息.

The explanation provided by Mohit is right, but I want to add some information about it after my testing.

我再次在我的身边对其进行测试,当我第一次对其进行测试时,该函数已由Blob存储成功触发.第二次,我将函数保留了片刻,然后将文件上传到Blob存储.大约13分钟后,我在监视器"屏幕中看到了日志.

I test it in my side again, when I test it first time, the function was triggered successfully by the blob storage. Second time, I left the function there for a moment and then upload a file to blob storage. It was almost 13 minutes before I saw the log in "Monitor" screen.

我认为造成这种情况的原因有两个,其中一个是Mohit提到的,消耗计划将导致该功能闲置一会儿.据我所知,如果我们将该功能保留大约20分钟,它将进入睡眠状态(不是热启动). 因此,当文件上传到Blob存储时,需要几分钟的时间才能开始.然后监视器"也需要大约5分钟才能显示登录屏幕.

I think there are two reasons to cause it, one is mentioned by Mohit, the consumption plan will lead to the function idle for a few moment. As far as I know, if we leave the function there for about 20 minutes, it will fall asleep(not hot start). So when the file was uploaded to blob storage, it needs a few minutes to start. And then the "Monitor" also needs about 5 minutes to show the log in screen.

由于上述两个原因,我等待大约13分钟才能看到监视器"中的日志.因此,也许您没有看到该日志,因为它出现得太晚了.对于这个问题,我认为您可以选择一个应用程序服务计划,如果您不在乎成本,或者选择一个消费计划,它不在乎等待时间.(或者选择F1:免费的应用程序服务计划)

Because of the two reasons above, I wait about 13 minutes to see the log in "Monitor". So maybe you didn't see the log because it appears too later. For this problem, I think you can choose an app service plan if you don't care about the cost or choose a consumption plan it you don't care the waiting time.(or choose an app service plan which is F1: Free).

希望这对您的问题有帮助〜

Hope it would be helpful to your problem~

这篇关于Azure Blob存储触发器功能未触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆