Azure / Azure/azure-functions-dotnet-worker
Is there a way to get the next scheduled occurence of an Azure Timer function? This issue seems to say that `TimerInfo` should have a schedule property, but I'm not seeing it in .NET 8.
- Dominant language
- C#
- Stars
- 466
- Forks
- 215
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 7
Description
Is there a way to get the next scheduled occurence of an Azure Timer function? This issue seems to say that `TimerInfo` should have a schedule property, but I'm not seeing it in .NET 8.
https://github.com/Azure/azure-functions-dotnet-worker/issues/954#issuecomment-1238433441
```
public static void CronJob([TimerTrigger("*/15 * * * * *")] TimerInfo timerInfo)
{
var schedule = timerInfo.Schedule as CronSchedule;
var next = schedule.GetNextOccurrence(DateTime.UtcNow);
. . .
}
```
Is the `GetNextOccurrence` ability just gone now? Is there any workaround?
_Originally posted by @dfaivre in https://github.com/Azure/azure-functions-dotnet-worker/discussions/2204_
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the .NET 8 TimerInfo API and the CronSchedule usage shown in the issue, then read the linked discussion and issue comment for the prior behavior. Done means confirming whether next-occurrence access is supported, identifying the supported workaround if one exists, or documenting the missing capability clearly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100