azure-webjobs-sdk
azure-webjobs-sdk copied to clipboard
TimerTrigger binding fails
when using the v3.0.0 sdk the timer trigger TimerInfo fails to bind to anything other than the parameter named myTimer; this break existing code using the UseMonitor and RunOnStartup is set
Error indexing method 'FileTransformation.FileInboundJobResp' [9/24/2018 12:59:04 PM] Microsoft.Azure.WebJobs.Host: Error indexing method 'FileTransformation.FileInboundJobResp'. Microsoft.Azure.WebJobs.Host: Can't bind parameter 'timerTrigger' to type 'Microsoft.Azure.WebJobs.TimerInfo'.
In my case it needs to be called "timer", otherwise if I call it "timerTrigger" it fails. Odd. This is still happening as of April 2019 with the latest SDK.
Still happening March 2021. (App Service Plan Linux, App just recently created)
Caused me quite some head scratching. So glad I found this issue.
Had this happen today and couldn't figure out what was happening until finding this thread, couldn't use timerTrigger as the name
Thanks so much for this post! I have been struggling for some time to figure the same problem out!
Chiming in late on this long standing issue. It appears that this issue here is that if you name your parameter "timerTrigger" it matches the binding contract name defined by the TimerTrigger extension here and that causes the indexing failure.
You can name the parameter anything other than "timerTrigger" and it'll work.
Thanks @mathewc! I have been working with MS support, and they have acknowledged an issue with using the actual name. I assume it might also apply to other cases like HttpTrigger, etc. It's easy enough to avoid using that name, but the key is to get it into the documentation that you should not use the reserved name, because it is difficult to identify the problem. I raised a doc issue about this, but it was closed without any followup: https://github.com/MicrosoftDocs/azure-docs/issues/97550. Maybe we could use this to update the docs?