What is the simplest way to run a timer-triggered Azure Function locally once?

后端 未结 7 882
醉话见心
醉话见心 2020-12-13 12:03

I have a few C# Azure Functions that run on a schedule using timer triggers. I\'ve set them up like so, where %TimerSchedule% refers to a cron expression in the

7条回答
  •  眼角桃花
    2020-12-13 12:28

    I had the same question, and used the DEBUG-flag to have the RunOnStartup only while debugging:

            public static void Run(
                [TimerTrigger("* 0 7 * * 1-5"
    #if DEBUG
                , RunOnStartup=true
    #endif
                )]TimerInfo myTimer, TraceWriter log)
            {
    

提交回复
热议问题