1

As per Function configuration, it has to fire every 5 minutes but the function is not triggered at all.It does trigger if I change it to seconds configuration 0/45 * * * * *.

@FunctionName("TestFunction")
public void TestFunction(
        @TimerTrigger(name = "req", schedule = "0 */5 * * * *") String timerInfo,
      ExecutionContext context
 ) {
    try {   
        // Do something.    
    } catch (Exception e) {
    } 
}

There is no exceptions thrown or log info.The issue occurs in both local eclipse debug and in cloud deployment.

Any help is appreciated, Thanks.

Kumar
  • 182
  • 13
  • Not able to repro this, either local or Azure site. `no exceptions thrown or log info`, do you mean no logs about the timer trigger execution? Could you provide the complete logs from local console? – Jerry Liu Jan 31 '19 at 03:35
  • I meant to say that there are no exceptions thrown in the console log while running locally and no exceptions when deployed in cloud. – Kumar Jan 31 '19 at 14:30

2 Answers2

2

Make sure Always ON is enable on your function app if you are not on consumption plan.

Ketan
  • 1,530
  • 7
  • 16
  • Pardon me for my lack of knowledge. Where can I find this "Always ON" setting ? – Kumar Jan 31 '19 at 14:34
  • 1
    (Dedicated hosting plan only) In your Function app's portal blade, go to Application Settings. ([docs](https://learn.microsoft.com/en-us/azure/azure-functions/functions-scale#always-on)) – Katy Shimizu Jan 31 '19 at 19:26
  • I face same issue.. any example on how to set this 'Always ON' in my Java (maven) app? I have to add smt in json setting? – Salvatore Nedia Nov 23 '20 at 20:28
1

I faced a similar issue. The reason for the azure functions in java to silently fail was because of the use of try and catch statements.

I was catching the errors and printing the stack trace. But the azure console does not provide output of the print statements. Hence the exception was getting caught and program continued to run.

Hence make sure to check for exceptions, if the program runs continuously but does not trigger as required.