Nilesh A
Nilesh A

Reputation: 153

Azure functions stopped working after Core 3.0 update

The code is working in Core 3.0 preview7 version, but after updating to 3.0 Azure functions started giving an error.

The error comes if I try to access builder service object. Also not able to debug the issue. Also tried updating Microsoft.Extensions.DependencyInjection 3.0 but still the same error.

public class Startup : FunctionsStartup
{
    public override void Configure(IFunctionsHostBuilder builder)
    {
    var descriptor = builder.Services.FirstOrDefault(d => d.ServiceType == typeof(IConfiguration)); // error after adding this
        var currentDirectory = $"{Environment.GetEnvironmentVariable("HOME")}\\site\\wwwroot";


        var configurationBuilder = new ConfigurationBuilder();

        var configuration = configurationBuilder.SetBasePath(currentDirectory)
            .AddJsonFile("local.settings.json", optional: true, reloadOnChange: true)
            .AddEnvironmentVariables()
                    .Build();
}
}

When executing the below error comes: Method not found: 'Microsoft.Extensions.DependencyInjection.IServiceCollection Microsoft.Azure.Functions.Extensions.DependencyInjection.IFunctionsHostBuilder.get_Services()'.

Upvotes: 1

Views: 1128

Answers (1)

Winthorpe
Winthorpe

Reputation: 1200

ASP.NET Core 3.0 not currently available for Azure App Service. [Microsoft Docs]

I understand the preview versions of .NET Core 3.0 [Microsoft Docs] are available on the Azure service.

Azure Functions 3.0, which will be fully compatible with Core 3.0, will be available in October - see this announcement

Upvotes: 2

Related Questions