TimerTrigger attribute using TimeSpan format works locally but fails when deployed
I've noticed that I can build/run/debug a Timer triggered Azure function in the VS2017 Preview tooling where the timer binding uses a timer schedule specified as a TimeSpan.
E.g in local.settings.json for my Azure functions project I specified "RefreshInterval": "01:00:00" and then use it in my function trigger binding like this
[FunctionName("MyRefreshFunction")]
public static void Run([TimerTrigger("%RefreshInterval%", RunOnStartup = true)] TimerInfo myTimer, TraceWriter log, ..
This all works fine locally but when I deploy this function project to Azure the functions fail as they are expecting only a CRON expression for the timer schedule parameter.
Is this expected behaviour? I can revert back to CRON expressions for now, but I'd expect that if I can configure it this way locally I should be able to do the same when it's deployed.
You can only use TimSpan expressions if you're running on an App Service plan. However, we should improve the error message to reflect that.
Ah yes, I am using the consumption plan. I picked up on the TimeSpan option by looking at the TimerTrigger attribute definition (see image). Improved error message sounds good to me 👍

Yes, I think we should also update the doccomment in TimerTriggerAttribute to make it clear that TimeSpan is not supported on the Consumption plan.
See https://github.com/Azure/azure-webjobs-sdk-script/issues/1561 for improving the error message.
I'll put out a PR shortly to improve the doccomment. Closing this issue.
@garthmason See https://github.com/Azure/azure-webjobs-sdk-extensions/pull/231.
Great, appreciate the quick response we are getting to theses issues!