appsettings.json
The JSON settings file an ASP.NET Core app reads at startup, where each object is a configuration section.
In more detail
appsettings.{Environment}.json, such as appsettings.Development.json, overrides matching keys for one environment. Keep defaults and public values here, never real secrets.
Related terms
- IConfiguration — The .NET interface for reading configuration, a merged set of key-value strings from settings files, environment variables and other providers.
- configuration section — A named group of related settings, such as the Catalog object in appsettings.json, that binds to one options class.
- configuration layering — Combining configuration from several providers in order, so later sources override earlier ones for the same key.
- JSON — A simple text format for structured data made of keys, values, lists and nested objects.
Taught in
- The Options Pattern: Strongly Typed Configuration — Modern .NET Core, C# & Enterprise Microservices
- Environment Layering and User Secrets — Modern .NET Core, C# & Enterprise Microservices