问题:部署的 Azure Function 应用程序未按我配置的每小时 CHRON 计划触发。
我做了什么
注意:我使用的是高级应用程序服务计划,因此我没有设置“始终开启”配置设置的选项
我使用运行时堆栈python创建了定时器触发函数,并使用CRON表达式将时间表设置为1小时。
在门户中创建功能应用程序时,我采取了应用程序服务高级计划和美国东部地区。
下面的代码工作正常。
代码:
import logging
import azure.functions as func
app = func.FunctionApp()
@app.schedule(schedule="0 0 */1 * * *", arg_name="myTimer", run_on_startup=True,
use_monitor=False)
def timer_trigger(myTimer: func.TimerRequest) -> None:
if myTimer.past_due:
logging.info('The timer is past due!')
logging.info('Python timer trigger function executed.')
我已将上述功能成功部署到azure门户中。检查下面:
该函数在 Azure 门户中也成功触发。检查监视器部分中的以下调用跟踪: