azureazure-functionstimer-trigger

Azure Function timer trigger not triggering when deployed


I have a timer-triggered function setup like this

public class PBARCronTrigger
{
    private readonly eReserveFunctions _settings;

    public PBARCronTrigger(IOptions<eReserveFunctions> settings)
    {
        _settings = settings.Value;
    }

    [FunctionName("PBARCronTrigger")]
    public async Task Run([TimerTrigger("%PBARCron%")] TimerInfo myTimer, ILogger log)
    {
        log.LogInformation($"PBARCronTrigger function executing at: {DateTime.Now}");

        using (var client = new HttpClient())

and I have the app setting for PBARCron set to every 5 minutes:

enter image description here

but the trigger is not triggering. I connect to live logs and nothing happens. It keeps on saying "No new trace in the past x min(s)"


Solution

  • Your cron expression doesn't look right to me. Checking it in an evaluator even states that it's non-standard and may not work in every environment.

    I think what you want is 0-55/5 * * * *, or more simply, */5 * * * *.