azure-webjobs-sdk icon indicating copy to clipboard operation
azure-webjobs-sdk copied to clipboard

TimerTrigger binding fails

Open grahamehorner opened this issue 7 years ago • 6 comments

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'.

grahamehorner avatar Sep 24 '18 12:09 grahamehorner

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.

zmarty avatar Apr 23 '19 17:04 zmarty

Still happening March 2021. (App Service Plan Linux, App just recently created)

Caused me quite some head scratching. So glad I found this issue.

mpth avatar Mar 09 '21 06:03 mpth

Had this happen today and couldn't figure out what was happening until finding this thread, couldn't use timerTrigger as the name

alexknipfer avatar Sep 08 '21 19:09 alexknipfer

Thanks so much for this post! I have been struggling for some time to figure the same problem out!

CraigGemmill avatar Sep 01 '22 12:09 CraigGemmill

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.

mathewc avatar Sep 12 '22 21:09 mathewc

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?

CraigGemmill avatar Sep 13 '22 12:09 CraigGemmill