时间触发的天蓝色功能在部署后立即触发 [英] Time triggered azure function to trigger immediately after deploy

查看:50
本文介绍了时间触发的天蓝色功能在部署后立即触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个每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.

这篇关于时间触发的天蓝色功能在部署后立即触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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