Azure / Azure/azure-functions-host
"scheduleExpression" property for Timer triggers should fallback to "schedule"
- Dominant language
- C#
- Stars
- 2k
- Forks
- 482
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 38
Description
If you create a `function.json` or a `FunctionMetadata` for timer trigger with a property `scheduleExpression`, it throws errors as host expects it to be `schedule` instead.
This is somewhat an issue, because the property inside the [TimerTriggerAttribute](https://github.com/Azure/azure-webjobs-sdk-extensions/blob/dev/src/WebJobs.Extensions/Extensions/Timers/TimerTriggerAttribute.cs#L44) is called `ScheduleExpression`. This is especially tricky for .NET 5 worker where we use Source Generation to convert these attribute properties to `FunctionMetadata`.
This also makes sense just for parity. We should add a fallback so that either `schedule` or `scheduleExpression` is deemed correct in this context.
Contributor guide
Research direction
Start with the TimerTriggerAttribute.cs reference in the issue and trace how timer-trigger FunctionMetadata reads schedule properties in the host. Verify that metadata using either schedule or scheduleExpression is accepted without the current error; add or update coverage where the existing timer-trigger validation is located.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100