Azure function time trigger is not working properly after isolated process model

lakshmi 816 Reputation points
2024-08-09T17:56:49.71+00:00

Hi Team,

We have upgraded the azure function to isolated process model and to .net 8.

Below is the time trigger implementation,

[Function("ActivityTrigger")]
public async Task Run([TimerTrigger("%ActivityTriggerTime%")] TimerInfo timer, FunctionContext context)
{
    _logger.LogInformation("------------- activity trigger started");




_logger.LogInformation("------------- next run time {NextRunTime}", nameof(ActivityTrigger
), timer?.ScheduleStatus?.Next);

}

Below is the cron expression we used,

"ActivityTriggerTime": "* */2 * * * *"

= > Trigger should be triggered every 2 minutes or 30 seconds.

But the next schedule run time is not getting logged correctly for every trigger.

ActivityTrigger next run time 08/09/2024 19:24:36

What is the correct cron format for providing the trigger time and it should log the next schedule status time.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,578 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. hossein jalilian 10,340 Reputation points
    2024-08-09T20:40:19.61+00:00

    Hello lakshmi,

    Thanks for posting your question in the Microsoft Q&A forum.

    If you want the function to trigger every 2 minutes (or every 30 seconds), you should use the following cron expressions:

    0 */2 * * * *


    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.