You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{"ApplicationInsights": {"ConnectionString": "<Connection string Alpha>"},// Other stuff}
appsettings.localhost.json (gitignored, local machine configuration)
{"ApplicationInsights": {"ConnectionString": "<Connection string Delta>"},// Other stuff}
Unfortunately, app insights is ignoring what's in appsettings.localhost.json because after acquiring my own custom configuration, it overlays its own configuration on top of that:
In my configuration setup, connection string Delta is the last one defined and should therefore "win", but appinsights is re-applying appsettings.json on top of that and therefore Alpha becomes the connection string that gets used.
App insights should not be overriding the user-provided configuration with additional default configuration files. These defaults should be applied to the internal configuration builder first, and then the userConfiguration should be overlayed on top of that so that user configuration is respected.
To Reproduce
Setup a plain aspnetcore project with the above 3 config files.
The text was updated successfully, but these errors were encountered:
*.csproj
file): net8Describe the bug
My app has some slightly custom configuration files, as follows:
Program.cs
appsettings.json
(git committed, baseline configuration)appsettings.localhost.json
(gitignored, local machine configuration)Unfortunately, app insights is ignoring what's in
appsettings.localhost.json
because after acquiring my own custom configuration, it overlays its own configuration on top of that:ApplicationInsights-dotnet/NETCORE/src/Microsoft.ApplicationInsights.AspNetCore/Extensions/DefaultApplicationInsightsServiceConfigureOptions.cs
Lines 36 to 43 in e34286b
In my configuration setup, connection string Delta is the last one defined and should therefore "win", but appinsights is re-applying
appsettings.json
on top of that and therefore Alpha becomes the connection string that gets used.App insights should not be overriding the user-provided configuration with additional default configuration files. These defaults should be applied to the internal configuration builder first, and then the userConfiguration should be overlayed on top of that so that user configuration is respected.
To Reproduce
Setup a plain aspnetcore project with the above 3 config files.
The text was updated successfully, but these errors were encountered: