MicrosoftDocs / azure-docs

Open source documentation of Microsoft Azure
https://docs.microsoft.com/azure
Creative Commons Attribution 4.0 International
10.2k stars 21.35k forks source link

Problem with TimerInfo in Azure functions .net 5 version #88861

Closed jmaragon closed 2 years ago

jmaragon commented 2 years ago

When using Timer binding function, the TimerInfo object is available in Microsoft.Azure.WebJobs.Extension package, but when that package is added to the project, there is a ambiguity within TimerTriggerAttribute, as it is defined both in Microsoft.Azure.WebJobs.Extension and in Microsoft Azure Functions.

Please clarify how to support binding to TimerInfo injected class should be done.

Thanks

Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

mike-urnun-msft commented 2 years ago

Thank you for your feedback! We will review and update as appropriate.

mike-urnun-msft commented 2 years ago

Hello @jmaragon - Could you elaborate on the ambiguity part more? Both the TimerInfo and the TimerTriggerAttribute types are under the same Microsoft.Azure.WebJobs namespace: https://github.com/Azure/azure-webjobs-sdk-extensions/tree/dev/src/WebJobs.Extensions/Extensions/Timers

mike-urnun-msft commented 2 years ago

Since we haven't heard back, we will now proceed to close this thread for now. If there are further questions regarding this matter, please reopen it and we will gladly continue the discussion.

Sellafield commented 2 years ago

Ambiguity is in TimerTriggerAttribute, which exists both in Microsoft.Azure.WebJobs and Microsoft.Azure.Functions.Worker namespaces.

Resolving ambiguity to WebJobs causes error AZFW0001, as WebJobsAttribute is not supported in .NET Worker (Isolated Process)

Resolving ambiguity to Functions.Worker causes function to throw an exception:

System.Private.CoreLib: Exception while executing function: Functions.PrintingFilesCleanup. System.Private.CoreLib: Result: Failure Exception: Microsoft.Azure.Functions.Worker.Diagnostics.Exceptions.FunctionInputConverterException: Error converting 1 input parameters for Function 'PrintingFilesCleanup': Cannot convert input parameter 'myTimer' to type 'Microsoft.Azure.WebJobs.TimerInfo' from type 'System.String'.

super-jb commented 1 year ago

Was this solved?

syazdian commented 1 year ago

Was this solved?

Sure not! They just close the tickets

TylerHaynie commented 1 year ago

still not fixed.

arpanpreneur commented 9 months ago

Now even I am stuck with this. What a nightmare.

alexanderecooper commented 4 months ago

I was able to fix this issue by updating the Microsoft.Azure.Functions.Worker.Extensions.Timer package to 4.3.0, TimerInfo has been added to the package in this version.