Azure功能未按计划时间触发 [英] Azure function is not triggering on scheduled time

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

问题描述

注意:即使看起来可能是重复,我的问题也有所不同,因此我要求您先阅读完整的描述,然后再通过仅阅读问题标题将问题匆匆记下.

Note: Even though it may seem duplicate, My issue is different and I request you to read complete description before hastily marking the question down just by reading Question title.

我打开了" Azure功能未按计划时间触发关于官方" azure-webjobs-sdk-script 的问题2017年5月24日-但尚未回复.所以我在这里再问这个.

I opened "Azure function is not triggering on scheduled time " issue on official "azure-webjobs-sdk-script" git repository on May 24, 2017-but there is no reply yet. So I am re-asking this here.

我在消费计划中使用了azure函数,并通过在function.json中设置以下cron表达式来安排它在世界标准时间每凌晨4.00执行:

I am using azure function in consumption plan, and have scheduled it to execute at every 4.00 am utc by setting following cron expression in function.json:

{  

"bindings": [
    {
      "name": "myTimer",
      "type": "timerTrigger",
      "direction": "in",
      "schedule": "0 0 4 * * *"
    }
  ],
  "disabled": false
}

仅当我登录到门户网站或单击功能刀片时,Azure函数才会按时执行.当我从门户网站注销时,它不会调用(建议系统侦听器或函数转到间隔一段时间后进入睡眠状态.

Azure function does get execute on time only if I am logged into portal or clicks on function blade. It does not invoke when I am logged out from portal (suggesting either system listener or function go to sleep after some interval).

他们的官方文档指出使用计划中的功能不需要任何其他设置(例如始终处于启用状态)即可保持该功能保持活动状态, Azure Functions主机的实例是根据传入事件的数量动态添加和删除的..因此,根据文档,我无需配置其他设置即可执行消费计划中的功能.

Their official documentation states that functions in consumption plan do not require any other settings (like Always on) to keep the function alive, instances of the Azure Functions host are dynamically added and removed based on the number of incoming events.. So as per documentation, no other settings I have to configure to execute function in consumption plan.

我尝试了什么?

  1. 来自"计时器触发的天蓝色函数未触发"这样的问题,我重新检查并确保了自己的计划(消费计划)和时区. (我希望它在utc中运行,因此不需要显式设置)

  1. From "Timer triggered azure function not getting triggered" question on SO, I re-checked and ensured my plan (consumption plan) and time zone. (I want it to run in utc, so no explicit setting is required)

来自"#1445:Azure函数计时器触发器未触发" git问题,我检查了是否只是未显示的日志.但是我可以肯定,除非我打开门户网站或手动触发它,否则不会触发日志,而不会触发实际功能.

From "#1445: Azure function timer trigger not firing" git issue, I checked whether it was just logs that are not appearing. But I am certainly sure, that its not the logs but the actual function does not get triggered unless I am having my portal on or trigger it manually.

如果尝试将日程表更改为更接近的递归调用,我尝试检查此行为是否存在-我安排了每2小时执行一次的函数,即使我注销或执行此日程表,该日程表也能正常工作不手动唤醒功能.这意味着将时间表设置为以较大的间隔(以我为例,每个)运行

I tried to check whether this behavior exists if I change the schedule to a more closer recursive invocations--I scheduled function to get executed at every 2 hours, and this schedule perfectly worked even when I logged out or did not awake function manually. This means, there is some issue when schedule is set to run on larger set of intervals (in my case each day)

推荐答案

#1534 ,在新功能应用中完全删除并重新部署该功能并没有重现该问题.因此,删除功能和/或功能应用-并重新部署它们应该可以使事情正常进行.同时,Azure团队宣布添加内部日志记录这将有助于将来的诊断.

As discussed here in #1534, deleting and redeploying the function completely in new function app did not reproduce the issue. So deleting the function and/or function app-and redeploying the same should make things working. Meanwhile, Azure team has announced to add internal logging which will help future diagnosis.

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

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