【发布时间】:2023-03-03 15:40:01
【问题描述】:
我正在尝试在我的 Azure Function 计时器触发器中为每一分钟创建一个 CRON。
根据我发现的文档:https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-timer#cron-examples
"0 */1 * * * *" 根本不运行。
"*/1 * * * * *" 确实每秒运行一次。
我哪里错了?
function.json 看起来像这样:
{
"bindings": [
{
"name": "myTimer",
"type": "timerTrigger",
"direction": "in",
"schedule": "0 */1 * * * *"
}
],
"scriptFile": "../dist/TriggerWork/index.js"
}
【问题讨论】:
-
您如何确认它不是每分钟都在运行?看起来正确就是我问的原因
-
是的 - 我已经等了超过 1 分钟。根据上面的链接,代码只是默认示例。当我使用
"*/1 * * * * *"时,我看到它正在记录 -
啊,我刚刚在控制台中注意到:
The listener for function 'Functions.TriggerWork' was unable to start. [4/17/19 4:09:22 AM] The listener for function 'Functions.TriggerWork' was unable to start. Microsoft.WindowsAzure.Storage: Settings must be of the form "name=value". -
看起来您没有配置正确的存储密钥。您是在本地测试还是在门户网站上测试?
-
@GeorgeChen - 抱歉不明白。它在本地运行。
标签: azure cron azure-functions