Understanding configuration
A configuration is generally stored as name-value pairs and can be grouped into a multi-level hierarchy. In the application startup file (Startup.cs
), you will get a default configuration provided by .NET 5. In addition, you can configure different built-in and custom configuration sources and then read them using different configuration providers whenever you need them anywhere in an application:
The preceding diagram shows the high-level relationship between an application, a configuration provider, and a configuration file. The application uses the configuration provider to read the configuration from the configuration source; the configuration can be environment-specific. Env A could be your development environment and Env B could be your production environment. At runtime, the application will read the right configurations based on the runtime context and environment where...