Search code examples
cronazure-webjobs

Azure Web jobs run multiple times on the provided cron pattern


I have this CRON pattern for my web jobs 0 0/12 20 * * * and it's running every 12 hours starting 8PM. now the problem is that in azure the service run for almost 5 times until 9PM. is there a way that it should only run once?


Solution

  • Your cron expression means it starts from 8pm and every runs 12 minutes. Cause the azure timer binding document couldn't be open for now, you could refer to this wiki: TimerTrigger.

    There are six fields {second} {minute} {hour} {day} {month} {day of the week} to schedule.

    So in your situation if you want to run every 12 hours starting 8PM. Yo could try this cron: 0 0 20/12 * * * or with this one 0 0 8,20 * * *. One is start from 8pm and every 12 hours and one is run at the specified time.