1

I have created an azure function v1 with parameter ILogger and when I hit F5 the console window has this exception:

Run: Microsoft.Azure.WebJobs.Host: Error indexing method Microsoft.Azure.WebJobs.Host: Cannot bind parameter 'logger' to type ILogger azure function

Does v1 azure function only work with TraceLogger ?

It worked using azure function v2, but that is .Net Core which is no option for me.

HelloWorld
  • 4,671
  • 12
  • 46
  • 78

1 Answers1

0

I test it in my side, both TraceWriter and ILogger works fine in my function V1. And when I publish it from local to azure, it also works as expect. So could you please check if you have installed the nuget packages and using them success in your function code.

I provide my function code below for your reference:

enter image description here

Hury Shen
  • 14,948
  • 1
  • 9
  • 18
  • I have had both usings at the top, still I get that error. I use the Microsoft.Net.sdk.functions 1.0.24 which seems old, but when I update to 3.0.8 latest nothing works anymore. The TimerTrigger Attribute is not recognized etc... – HelloWorld Jul 07 '20 at 10:34
  • do you use ILogger or ILogger see https://github.com/Azure/azure-functions-host/issues/4425 – HelloWorld Jul 07 '20 at 11:55