Azure 函数未在预定时间触发

Azure function is not triggering on scheduled time

注意:尽管看起来重复,我的问题是不同的,我要求你在匆忙标记之前阅读完整的描述只需阅读问题标题即可提出问题。

我在 2017 年 5 月 24 日打开了“Azure function is not triggering on scheduled time " issue on official "azure-webjobs-sdk-script”git 存储库-但还没有回复。所以我是re-asking这个。

我在消费计划中使用 azure 函数,并通过在 function.json:

中设置以下 cron 表达式,安排它在世界标准时间上午 4 点执行
{  

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

Azure 函数确实会按时执行 仅当我登录到门户或单击函数时 blade。 当我从门户注销时它不会调用(建议系统侦听器或函数在一段时间后进入休眠状态)。

他们的 official documentation 声明消费计划中的函数不需要任何其他设置(如始终打开)来保持函数活动,Azure Functions 主机的实例是动态添加和删除的基于传入事件的数量。。因此,根据文档,我无需配置其他设置即可在消费计划中执行功能。

我试过什么?

  1. 从SO上的“”问题,我re-checked并确定了我的计划(消费计划)和时区。 (我希望它在 utc 中为 运行,因此不需要显式设置)

  2. 从“#1445: Azure function timer trigger not firing”git问题,我检查了是否只是没有出现的日志。但我可以肯定,它不是日志,而是实际功能不会被触发,除非我打开我的门户或手动触发它。

  3. 如果我将计划更改为更接近的递归调用,我尝试检查是否存在这种行为——我计划函数每 2 小时执行一次,即使我在注销或未手动唤醒功能。这意味着,当时间表设置为 运行 更大的间隔时会出现一些问题(在我的例子中是每个

#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中所述,这将有助于未来的诊断。