简体   繁体   English

Azure 计时器触发函数默认计时器

[英]Azure Timer Triggered Function default timer

I have created an azure function and is triggered by timer on specific schedule.我创建了一个 azure 函数,并由计时器按特定时间表触发。 I need this timer schedule configurable hence I would add this trigger schedule to azure function configuration settings using %TimerSchedule%.我需要可配置此计时器计划,因此我将使用 %TimerSchedule% 将此触发器计划添加到 azure 函数配置设置中。

public static void Run([TimerTrigger("%TimerSchedule%")]TimerInfo myTimer, ILogger log)
{

   // Function Code here

}

Is there a way to have some default schedule if I do not add this configuration setting?如果我不添加此配置设置,有没有办法拥有一些默认计划?

Thank you!谢谢!

Add a second TimerTrigger function with whatever default schedule you want.使用您想要的任何默认计划添加第二个 TimerTrigger 函数。 At the beginning of that function check the existence of %TimerSchedule% and if it exists then exit.在该函数的开头检查 %TimerSchedule% 是否存在,如果存在则退出。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM