I have a set of Azure Functions, written in C#, and running on Azure Function v2 runtime (.NET Core 2.2), which work just fine.
Now I was going to create a new set of Azure Function and I want to use the v3 runtime (.NET Core 3.1). However, when "transferring" the code from my existing code base, I ran into this problem: I have a Startup.cs file that's setting up the Dependency Injection for the Azure Functions, and this is what it looked like in my Azure Function v2 project:
[assembly: FunctionsStartup(typeof(MyCorp.MyProject.Infrastructure.Startup))]
namespace MyCorp.MyProject.RisWebportalService.Infrastructure
{
public class Startup : FunctionsStartup
{
public override void Configure(IFunctionsHostBuilder builder)
{
builder.Services.AddHttpClient();
// more lines here, setting up DI
}
}
}
When I tried to use this in the Azure Function v3 project, I get an error on the builder.Services.AddHttpClient(); line - seems IFunctionsHostBuilder in v3 doesn't have this extension method anymore......
So what do I do instead? I cannot seem to find any really useful documentation on any breaking changes in Azure Function runtime between v2 and v3 - any pointers?
