OrchardCMS / OrchardCore

Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
https://orchardcore.net
BSD 3-Clause "New" or "Revised" License
7.23k stars 2.34k forks source link

Misleading documentation section on the hierarchy of configuration sources #11956

Open Cinnam00n opened 2 years ago

Cinnam00n commented 2 years ago

Discussed in https://github.com/OrchardCMS/OrchardCore/discussions/11955

Documentation states:

Orchard Core supports a hierarchy of Configuration Sources

  • The Startup ASP.NET Core Project, e.g. OrchardCore.Cms.Web.csproj, appsettings.json, or by environment appsettings.Development.json.
  • Global Tenant Configuration App_Data/appsettings.json, or by environment App_Data/appsettings.Development.json.
  • Individual Tenant Configuration files located under each Tenant Folder in the App_Data/Sites/{tenant_name}/appsettings.json folder. Note: These are mutable files, and do not support an Environment version.
  • Environment Variables, or AppSettings as Environment Variables via Azure.

The Configuration Sources are loaded in the above order, and settings lower in the hierarchy will override values configured higher up, i.e. an Global Tenant value will always be overridden by an Environment Variable.

Then in the bottom it states:

By default an Orchard Core site will use CreateDefaultBuilder in the Startup Project's Program.cs which will load IConfiguration in the following order

  • Startup project appsettings.json
  • Startup project appsettings.{environment}.json
  • User Secrets (if environment is Development)
  • Environment Variables
  • Command Line Args
  • IShellConfiguration will then add these 1. App_Data/appsettings.json 2. App_Data/Sites/{tenant_name}/appsettings.json for the particular tenant

Which I find confusing since the two sections don't agree on the precedence between environment variables and tenant configurations.

hishamco commented 2 years ago

Could you please update the docs to remove the confusion?

Cinnam00n commented 2 years ago

@hishamco Certainly. I'll make a pull request in a moment.

Piedone commented 6 months ago

I think only one section detailing the configuration hierarchy should remain.