Blither, Blather, Web Content Management.
Blog » EFCore 2.2.0 on Azure Functions 2 Bug

EFCore 2.2.0 on Azure Functions 2 Bug

I ran into a bug using Entity Framework Core on Azure Functions. It was easy to avoid once I knew what the problem was, but I had a tough time finding it because it doesn't have much exposure yet. 

Jumping to the fix, if you're using Azure Functions 2, make sure you avoid using Entity Framework Core 2.2.0. Downgrade your EFCore nuget package to Microsoft.EntityFrameworkCore 2.1.4. I'm guessing the issue is resolved by the time 2.2.1 is released.
  • To reproduce the bug, create a new Azure Function using the V2 functions (I used a timer).
  • Make sure it runs.
  • Add the Microsoft.EntityFrameworkCore v2.2.0 nuget package
  • NOTE: if you've referenced other packages that require EFCore v2.2.0, such as EFCore.Design or EFCore.SqlServer, , you'll need to downgrade them as well.
Now when the function is executed, you will see an Error Indexing each function in the project.

[12/28/2018 3:22:30 PM] Error indexing method 'Function1.Run'
[12/28/2018 3:22:30 PM] Microsoft.Azure.WebJobs.Host: Error indexing method 'Function1.Run'. Microsoft.Azure.WebJobs.Host: Cannot bind parameter 'log' to type ILogger. Make sure the parameter Type is supported by the binding. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.).

Error Screenshot
Posted: 12/28/2018 3:18:56 PM by Ryan Miller | with 0 comments
Filed under: Azure Functions