Azure / azure-functions-dotnet-worker

Azure Functions out-of-process .NET language worker
MIT License
419 stars 181 forks source link

Azure Functions with ASP.NET Core Fails to Read appsettings with Comments, Causing System.Text.Json.JsonReaderException #2707

Open BigDyma opened 2 weeks ago

BigDyma commented 2 weeks ago

Description

When integrating isolated Azure Functions with ASP.NET Core, all HTTP triggered functions fail with 500due to a System.Text.Json.JsonReaderException. This exception occurs when comments are present in the appsettings configuration files, exception occurs at Worker.Extensions.Http.AspNetCore/src/AspNetMiddleware/FunctionsEndpointDataSource.cs:135

Removing comments from the appsettings configuration files resolves the issue

Platform: Linux Ubuntu

Steps to reproduce

Set up a project with isolated Azure Functions and integrate it with ASP.NET Core.

Use appsettings configuration files that contain comments.

Run the project and try to access any HTTP triggered functions.