我有一个每1小时触发一次的时间触发的天蓝色函数.我的要求是,它应每小时触发一次,但部署后也应立即触发一次? 使用cron表达式是实现此目的的唯一方法吗?
I have a time-triggered azure function triggered every 1 hour. My requirement is that, it should get triggered every hour but once also immediately after the deployment ? Is playing with cron expression my only way for this ?
推荐答案没有与部署直接相关的东西.记录在此处的runOnStartup触发器运行时启动时可以使用您的函数,但不会由于部署而导致运行时启动.
There isn't something directly tied to the deployment. The runOnStartup setting, documented here, triggers your function when the runtime starts, but won't cause the runtime to start as a result of a deployment.
您最好的选择可能是自定义您的部署,如此处记录的,并在部署完成后调用您的函数(通过发出HTTP请求).您可以共享代码,并拥有一个HTTP触发函数,该函数使用与计划中运行的计时器函数相同的逻辑.
Your best option would likely be to customize your deployment, as documented here, and invoke your function (by issuing an HTTP request) once the deployment completes. You can share the code and have an HTTP triggered function that uses the same logic as the timer function that runs on a schedule.
更多推荐
时间触发的天蓝色功能在部署后立即触发
发布评论