0

I have a function App. type is Timetrigger. I have given the time trigger expression 0 0 * * * * , as my requirement it to run with 1 Hour interval. I have refereed the TimeTrigger Cheat Sheet

But Unfortunetly its triggering in each 5 min. Somehow it's not working. Help me regarding this.

target--> Run the function App in the interval of 1 Hour.

2
  • could you post your code please ? Commented Mar 22, 2018 at 7:02
  • public static void Run([TimerTrigger("0 0 * * * *")]TimerInfo myTimer, TraceWriter log) { //Code Here } Commented Mar 22, 2018 at 7:04

3 Answers 3

2

If you have changed your code, I suggest you could right click project>rebuild your project to try again. Or you could try to use expression like '0 0 */1 * * *'.

The result:

enter image description here

But not sure why its getting triggered 5 min while putting the code in Azure Portal.

The code in portal and Visual Studio is different. You could try to right click project>publish>choose Azure function service to publish your function to portal. Then check the schedule in function.json:

enter image description here

In Portal, you could also click '+' to create TimeTrigger in Azure function service directly:

enter image description here

Sign up to request clarification or add additional context in comments.

3 Comments

You are right, I can see the same window. But not sure why its getting triggered 5 min while putting the code in Azure Portal. In Vs it works i guess Perfect.
I didn't went to this much Json Depth, but i think i got the resolution :). If we click the Intergrate tab, then we will get the Timer , I missed to update there. But still Was thinking , if we update in the code, then it suppose to update here as well.
Yes you are right, I haven't done it, and was thinking after updating in the code, it should work. but its not
0

I got a conclusion out of the Issue, Although you will update the Time trigger schedule in the Code level, this will not impact the Running schedule. What ever is there in the configuration ( go to Integrate tab of the function App & check the timer value). Code value changes not impacting the config values. Need to change the config values manually.

1 Comment

If you are using VS, updating code and publishing is enough. function.json is generated by the VS tools. If this is not the case, can you provide exact repro steps with VS version you are using?
0

You can set the trigger time as a config value, something like this:

[FunctionName(nameof(TimerFunction))]
        public static async Task Run(
            [TimerTrigger("%schedule%")]
            TimerInfo timerInfo, 
            TraceWriter log)
{}

and then define schedule in the Application Settings of your Function App in Azure portal:

schedule 0 */5 * * * * (in this case every five minutes)

I'm using crontab.guru for choosing triggering intervals

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.