configuration layering
Combining configuration from several providers in order, so later sources override earlier ones for the same key.
In more detail
ASP.NET Core layers appsettings.json, then appsettings.{Environment}.json, then user secrets in Development, then environment variables and command-line arguments. A misspelled environment name silently leaves defaults in place, so log the active environment.
Related terms
- configuration provider — A source of configuration values, such as appsettings.json, an environment file, environment variables or user secrets.
- hosting environment — The named environment an app runs in, such as Development, Staging or Production, set by the ASPNETCORE_ENVIRONMENT variable.
- appsettings.json — The JSON settings file an ASP.NET Core app reads at startup, where each object is a configuration section.
- user secrets — A .NET development tool that stores secrets for a project in your user profile, outside the project folder, so they never reach source control.
Taught in
- Environment Layering and User Secrets — Modern .NET Core, C# & Enterprise Microservices