Scheduled Azure Functions Execution

Anonymous
2022-06-25T06:05:07.397+00:00

Scheduled the Azure Function to run at two different timings like 6:30 AM and 1:30PM.

When I stop the function, Function didn't run at scheduled timings.
At 11 AM, I have started the function and run automatically even the scheduled time is not equal to current time.

Is there any queue to manage the scheduled executions when the function should run but it is stopped?

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

Accepted answer
  1. MughundhanRaveendran-MSFT 12,506 Reputation points
    2022-06-26T06:54:06.053+00:00

    Hi anonymous user ,

    Thanks for reaching out to Q&A forum.

    I am assuming that you have stopped the function app manually at your end. If that is the case, it is expected that the timer trigger didnt run as per the schedule as the Function host is not running. Please note that, irrespective of the timer schedule, the function needs to be running all the time. This is to make sure that the function host is up and running.

    The executions that happened at 11 AM might be older executions that the function might have missed when the app was stopped. You can look at the monitor section of the function and check the invocation logs for more details. The timer trigger function itself would trigger based on the cron schedule and there is no need for any managed queue.

    If the function app was stopped automatically by itself, we need to troubleshoot further. Please let me know.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Udaiappa Ramachandran 726 Reputation points MVP
    2022-06-25T15:57:16.277+00:00

    You cannot perform ad-hoc scheduling with Azure functions, if you would prefer you can use Azure Automation account runbooks then run the scheduler.

    For some reason, your choice is to use Azure Functions because you have done all code then try the following.

    1. Create a function (consumption plan), let it run all times, you are not paying until your run your code
    2. Create a Trigger Binding (Ex., Azure Storage Queue Trigger)
      215013-image.png
    3. Add a Queue entry with visibility timeout until 6:30 AM, In this case queue entry will be visible at 6:30 AM then will execute once it is done, create a new queue entry with visibility timeout until 1:30 PM
    4. Repeat step#3 to create new queue entry with visibility timeout so that it automatically visible 6:30 AM and 1:30 PM
    5. Make sure to handle exceptions to avoid no entry or poison entry
    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.