How to clear timer last scheduled for an Azure Function

Niall McAllister 0 Reputation points
2023-11-25T21:00:35.2466667+00:00

I have an ETL Azure Function which each time it runs, syncs data across from my CosmosDB to a postgres DB. Each time it runs, it picks up items which have been modified since the last time the function ran (timer.ScheduleStatus.Last). I need to reset the data so that it picks up all the items next time because of a change I've made to the model. What would I need to update to ensure the last scheduled timer is cleared, so the next time the function runs, it thinks it's the first time it's ran and picks up all items

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

1 answer

Sort by: Most helpful
  1. MayankBargali-MSFT 70,826 Reputation points
    2023-11-27T05:33:15.52+00:00

    @Niall McAllister Thanks for reaching out. Can you please confirm in which language you are running your code? In case if it is C# then you can leverage the StartFromBeginning attribute in your code.

    This option tells the Trigger to read changes from the beginning of the container's change history instead of starting at the current time. Reading from the beginning only works the first time the trigger starts, as in subsequent runs, the checkpoints are already stored. Setting this option to true when there are leases already created has no effect.

    1 person found this answer helpful.

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.