-
Notifications
You must be signed in to change notification settings - Fork 25.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Configuration doc to use double underscores instead of colons for hierarchical config keys (4968) #5876
Conversation
Pull from main
merge from docs
merge from docs
@@ -108,8 +108,7 @@ Configuration considerations: | |||
* `IOptionsSnapshot` can reload configuration data when it changes. For more information, see [IOptionsSnapshot](xref:fundamentals/configuration/options#reload-configuration-data-with-ioptionssnapshot)., | |||
* Configuration keys are **not** case-sensitive. | |||
* **Never** store passwords or other sensitive data in configuration provider code or in plain text configuration files. Don't use production secrets in development or test environments. Specify secrets outside of the project so that they can't be accidentally committed to a source code repository. Learn more about [how to work with multiple environments](xref:fundamentals/environments) and managing [safe storage of app secrets in development](xref:security/app-secrets). | |||
* If a colon (`:`) can't be used in environment variables on a system, replace the colon (`:`) with a double-underscore (`__`). | |||
|
|||
* A colon (`:`) may also be used for hierarchigal config keys, but may not work on all platforms. Double underscore (__) is supported by all platforms. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- may also --> may
- hierarchigal --> hierarchical
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -43,7 +43,7 @@ The app reads and displays the following configuration settings: | |||
|
|||
[!code-json[](index/sample/ConfigJson/appsettings.json)] | |||
|
|||
Configuration consists of a hierarchical list of name-value pairs in which the nodes are separated by a colon. To retrieve a value, access the `Configuration` indexer with the corresponding item's key: | |||
Configuration consists of a hierarchical list of name-value pairs in which the nodes are separated by a double underscore (`__`). To retrieve a value, access the `Configuration` indexer with the corresponding item's key: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't quite right. The double underscore syntax only applies to config values specified in env vars. When interacting with the config api you should use colons.
@@ -108,8 +108,7 @@ Configuration considerations: | |||
* `IOptionsSnapshot` can reload configuration data when it changes. For more information, see [IOptionsSnapshot](xref:fundamentals/configuration/options#reload-configuration-data-with-ioptionssnapshot)., | |||
* Configuration keys are **not** case-sensitive. | |||
* **Never** store passwords or other sensitive data in configuration provider code or in plain text configuration files. Don't use production secrets in development or test environments. Specify secrets outside of the project so that they can't be accidentally committed to a source code repository. Learn more about [how to work with multiple environments](xref:fundamentals/environments) and managing [safe storage of app secrets in development](xref:security/app-secrets). | |||
* If a colon (`:`) can't be used in environment variables on a system, replace the colon (`:`) with a double-underscore (`__`). | |||
|
|||
* A colon (`:`) may be used for hierarchical config keys, but may not work on all platforms. Double underscore (__) is supported by all platforms. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only true for specifying config values in env vars.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to clarify that double underscores are only used to specify config value using env vars.
@danroth27 how does that look? |
It doesn't look like my first comment in the JSON config section was addressed. |
@danroth27, look better? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
@isaac2004 Thank you for all of your work on this PR! |
* Update azure-apps-preview-notice.md (#5857) * Link to .NET Core CLI publish command doc (#5864) * Link to .NET Core CLI publish command doc * Verbiage tweak * fix typo (#5866) * Update intro.md (#5869) `classnameID` (where `classname` is the name of the class, such as `Student`) as the primary key. In `classnameID`, `classname` is the name of the class, such as `Student` in * Update view-components.md (#5872) altering range of code displayed to remove hanging closing } and closing table tag * C13511: Spaces should be replaced to avoid localization problems (#5871) Hello, @Rick-Anderson, Localization team has reported source content issue that causes localized version to have broken format compared to en-us version. Please, help to check my proposed file change into the article and help to merge if you agree with fix. If not, please, let me know either if you would like me to fix it in another way within this PR, if you prefer to fix it in another PR or if I should close this PR as by-design. In case of using another PR, please, let me know of your PR number, so we can confirm and close this PR. Many thanks in advance. * CI Update (#5878) * Recommended language change (#5883) * Updated with NET Core SDK 2.0 commands (#5886) * Updated with NET Core SDK 2.0 commands * Quick UE pass * Prevent javascript injection. (#5885) * Troubleshoot SDK warnings (#5880) * WIP Troubleshoot SDK warnings * Work * work * Address Gauntlet warning in ms.date value * Adjust H2 title casing and spacing * Quick UE pass * Update Configuration doc to use double underscores instead of colons for hierarchical config keys (4968) (#5876) * changes to configuration doc * fixes for scott * change for Dan * Update index.md * Code fence double underscore and add missing period * Eliminate unnecessary sentence * Missing npm task runner extension (#5893) * Revert "Missing npm task runner extension (#5893)" (#5894) This reverts commit a90faeb. * Note about task runner explorer option (#5895) * Note about task runner explorer option The gulp file has to be in the root directory or in the directory with package.json not in any subdirectory. * verbiage tweaks * added anchored link (#5896)
Based on conversation in #4968, changing language for hierarchigal config keys
@scottaddie @rachelappel
Internal Review Page