Skip to content

Commit c438383

Browse files
Update nuget.exe to modernize package structure. (#215)
1 parent 0d3af82 commit c438383

27 files changed

+299
-60
lines changed

.nuget/NuGet.exe

632 KB
Binary file not shown.

MicrosoftConfigurationBuilders.sln

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,17 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{905D083F-6
102102
EndProject
103103
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SamplesLib", "samples\SamplesLib\SamplesLib.csproj", "{BAA5EB76-5A85-48D6-9E8F-A01A309A2879}"
104104
EndProject
105+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "nuget-docs", "nuget-docs", "{1F8C44D6-1DF2-4CB0-9A93-AC6BF61034E5}"
106+
ProjectSection(SolutionItems) = preProject
107+
src\packages\assets\Readme-Azure.md = src\packages\assets\Readme-Azure.md
108+
src\packages\assets\Readme-AzureAppConfig.md = src\packages\assets\Readme-AzureAppConfig.md
109+
src\packages\assets\Readme-Environment.md = src\packages\assets\Readme-Environment.md
110+
src\packages\assets\Readme-Json.md = src\packages\assets\Readme-Json.md
111+
src\packages\assets\Readme-KeyPerFile.md = src\packages\assets\Readme-KeyPerFile.md
112+
src\packages\assets\Readme-UserSecrets.md = src\packages\assets\Readme-UserSecrets.md
113+
src\packages\assets\Readme.md = src\packages\assets\Readme.md
114+
EndProjectSection
115+
EndProject
105116
Global
106117
GlobalSection(SolutionConfigurationPlatforms) = preSolution
107118
Debug|Any CPU = Debug|Any CPU
@@ -172,6 +183,7 @@ Global
172183
{18D8B490-1CBC-4783-B6D7-D1A88E832224} = {2F759F48-7F89-4811-8F94-380BCCC83C69}
173184
{0DBFA194-1632-40C0-A072-C59A9280412B} = {2F759F48-7F89-4811-8F94-380BCCC83C69}
174185
{BAA5EB76-5A85-48D6-9E8F-A01A309A2879} = {2F759F48-7F89-4811-8F94-380BCCC83C69}
186+
{1F8C44D6-1DF2-4CB0-9A93-AC6BF61034E5} = {905D083F-6414-4DEA-9779-76C8A2518F8D}
175187
EndGlobalSection
176188
GlobalSection(ExtensibilityGlobals) = postSolution
177189
SolutionGuid = {6380A53F-A088-4D0B-B415-C8D16222F022}

README.md

Lines changed: 16 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
11
# Configuration Builders
22

3-
[ConfigurationBuilder](https://docs.microsoft.com/en-us/dotnet/api/system.configuration.configurationbuilder?view=netframework-4.7.1)s are a feature of the full .Net
4-
Framework that were introduced in .Net 4.7.1. You can read about the concept in [this blog post](http://jeffreyfritz.com/2017/11/modern-configuration-for-asp-net-4-7-1-with-configurationbuilders/).
5-
While the framework for executing configuration injection now exists in .Net as of 4.7.1 with that feature, the framework does not ship with any pre-made builders in box.
6-
The goal of this project is for Microsoft to provide a basic set of Configuration Builders that should make it easy for developers to leverage this feature in their apps. They
7-
are also intended to address some of the basic dynamic/non-local configuration needs of applications as they move into a container and cloud focused environment.
3+
[ConfigurationBuilder](https://docs.microsoft.com/en-us/dotnet/api/system.configuration.configurationbuilder?view=netframework-4.7.1)s are a feature of the full .Net Framework that were introduced in .Net 4.7.1. You can read about the concept in [this blog post](http://jeffreyfritz.com/2017/11/modern-configuration-for-asp-net-4-7-1-with-configurationbuilders/). While the framework for executing configuration injection now exists in .Net as of 4.7.1 with that feature, the framework does not ship with any pre-made builders in box. The goal of this project is for Microsoft to provide a basic set of Configuration Builders that should make it easy for developers to leverage this feature in their apps. They are also intended to address some of the basic dynamic/non-local configuration needs of applications as they move into a container and cloud focused environment.
84

9-
The set of builders produced here are styled as "Key/Value Config Builders." The architecture of `ConfigurationBuilder` in the framework is actually quite flexible and can
10-
be leveraged to handle a great number of unique situations. To keep things as easy and as broadly applicable as possible though, this project focuses on simple key/value
11-
scenarios.
5+
The set of builders produced here are styled as "Key/Value Config Builders." The architecture of `ConfigurationBuilder` in the framework is actually quite flexible and can be leveraged to handle a great number of unique situations. To keep things as easy and as broadly applicable as possible though, this project focuses on simple key/value scenarios.
126

13-
For more information about Configuration Builders and the features and builders in this project in particular, please refer to the docs
14-
linked here:
7+
For more information about Configuration Builders and the features and builders in this project in particular, please refer to the docs linked here:
158

169
* [Introduction to Configuration Builders in .Net](docs/Intro.md)
1710
* [Key/Value Config Builders](docs/KeyValueConfigBuilders.md)
@@ -23,44 +16,23 @@ linked here:
2316
<a name="updates"></a>
2417
### V3 Updates:
2518
* :warning: ***Breaking Change*** - `Expand` mode is gone. It has been [replaced by `Token` mode](docs/KeyValueConfigBuilders.md#mode).
26-
* `Utils.MapPath` - This was somewhat broken in ASP.Net scenarios previously. It should now reliably go against `Server.MapPath()` in ASP.Net scenarios. It has
27-
also been updated to fall back against the directory of the config file being processed when resolving the app root in the case of a `Configuration`
28-
object being created by `ConfigurationManager.OpenConfiguration*` API's rather than being part of a fully-initialized runtime configuration stack.
19+
* `Utils.MapPath` - This was somewhat broken in ASP.Net scenarios previously. It should now reliably go against `Server.MapPath()` in ASP.Net scenarios. It has also been updated to fall back against the directory of the config file being processed when resolving the app root in the case of a `Configuration` object being created by `ConfigurationManager.OpenConfiguration*` API's rather than being part of a fully-initialized runtime configuration stack.
2920
* Json use has migrated to use `System.Text.Json` instead of `Newtonsoft.Json`.
30-
* The [Azure Config Builders](#azure-config-builders) have been updated to require a newer minimum version of `Azure.Identity` by default which allows for more
31-
methods of connecting to Azure, such as **User-Assigned Managed Identity**, or **Client Certificate-based** via environment variables. Also a pair of overloads
32-
(`GetCredential` and `GetSecretClientOptions/GetConfigurationClientOptions`) have been added for users who need something more than `DefaultAzureCredential`
33-
with default client options can provide.
34-
* Added *RecursionGuard* to help detect and prevent situations where a `ConfigurationBuilder` accessing values from a `ConfigurationSection` other than the one
35-
which it is currently processing could result in stack overflow.
36-
* `optional` attribute is obsolete => [`enabled`](docs/KeyValueConfigBuilders.md#enabled) attribute which provides more versatility. (The `optional` attribute is still parsed and recognized in the absence
37-
of the newer [`enabled`](docs/KeyValueConfigBuilders.md#enabled) attribute, but builders should migrate to use the new attribute name when possible. Installation scripts should try to handle this
38-
automatically.)
39-
* Character Mapping - Some config builders have had an internal mapping of characters that might exist in keys in the config file but are illegal in keys at the
40-
source. As more scenarios come to light and individual prefrences are not always unanimous, V3 instead adds the [`charMap`](docs/KeyValueConfigBuilders.md#charmap) attribute to allow this character
41-
mapping to work with all **KeyValueConfigBuilders** and to be handled in an easily configurable manner.
42-
* `ConnectionStringsSectionHandler2` - A new section handler for the `<connectionStrings>` section has been included in the base package. This new handler will
43-
allow updating of both the 'connectionString' attribute as well as the 'providerName' attribute. It does require the builders and source of config data to be
44-
aware of this new ability though. The default section handler for the `<connectionStrings>` section has not been updated and remains as it was in previous
45-
versions, so apps wishing to take advantage of the new handler will have to wire it up in their config. More details can be found in the
46-
[SectionHandlers documentation](docs/SetionHandlers.md#ConnectionStringsSectionHandler2).
21+
* The [Azure Config Builders](docs/KeyValueConfigBuilders.md#azure-config-builders) have been updated to require a newer minimum version of `Azure.Identity` by default which allows for more methods of connecting to Azure, such as **User-Assigned Managed Identity**, or **Client Certificate-based** via environment variables. Also a pair of overloads (`GetCredential` and `GetSecretClientOptions/GetConfigurationClientOptions`) have been added for users who need something more than `DefaultAzureCredential` with default client options can provide.
22+
* Added *RecursionGuard* to help detect and prevent situations where a `ConfigurationBuilder` accessing values from a `ConfigurationSection` other than the one which it is currently processing could result in stack overflow.
23+
* `optional` attribute is obsolete => [`enabled`](docs/KeyValueConfigBuilders.md#enabled) attribute which provides more versatility. (The `optional` attribute is still parsed and recognized in the absence of the newer [`enabled`](docs/KeyValueConfigBuilders.md#enabled) attribute, but builders should migrate to use the new attribute name when possible. Installation scripts should try to handle this automatically.)
24+
* Character Mapping - Some config builders have had an internal mapping of characters that might exist in keys in the config file but are illegal in keys at the source. As more scenarios come to light and individual prefrences are not always unanimous, V3 instead adds the [`charMap`](docs/KeyValueConfigBuilders.md#charmap) attribute to allow this character mapping to work with all **KeyValueConfigBuilders** and to be handled in an easily configurable manner.
25+
* `ConnectionStringsSectionHandler2` - A new section handler for the `<connectionStrings>` section has been included in the base package. This new handler will allow updating of both the 'connectionString' attribute as well as the 'providerName' attribute. It does require the builders and source of config data to be aware of this new ability though. The default section handler for the `<connectionStrings>` section has not been updated and remains as it was in previous versions, so apps wishing to take advantage of the new handler will have to wire it up in their config. More details can be found in the [SectionHandlers documentation](docs/SetionHandlers.md#ConnectionStringsSectionHandler2).
26+
* `AzureAppConfiguration` nuget package version is revved to match the rest of this suite of builders, rather than being 1 major version behind. (ie, `AzureAppConfiguration:3.0` now depends on `Base:3.0` rather than `AzureAppConfiguration:1.0` depending on `Base:2.0`)
4727

4828
### V2 Updates:
4929
* Azure App Configuration Support - There is a [new builder](docs/KeyValueConfigBuilders.md#azureappconfigurationbuilder) for drawing values from the new Azure App Configuration service.
50-
* ConfigBuilder Parameters from AppSettings - This has been one of the most asked for features of these config builders. With V2, it is now possible to
51-
read initialization parameters for config builders from `appSettings`. Read more about it [here](docs/KeyValueConfigBuilders.md#appsettings-parameters).
52-
* Lazy Initialization - As part of the work to enable pulling config parameters from `appSettings`, these key/value configuration builders now support a
53-
lazy initialization model. Things that must happen immediately can be left in the existing `Initialize(name, config)` method, or builders can leverage
54-
the new `LazyInitialize(name, config)` method for things that can happen just before retrieving values. All builders in this project have been updated to
55-
be lazy whenever possible.
56-
* Updateable Keys - Builders can now massage key names before inserting into config. The [AzureKeyVaultConfigBuilder](docs/KeyValueConfigBuilders.md#azurekeyvaultconfigbuilder) has been
57-
updated to use this feature to allow embedding 'version' tags in key names instead of applying a single 'version' tag to the builder. (Note: This is
58-
seperate from, and performed *after* prefix stripping.)
59-
* **[[Obsolete]] This has been superceded by the [enabled](docs/KeyValueConfigBuilders.md#enabled) tag.** (~~Base Optional Tag - The `optional` tag that some of the builders in
60-
this project employed in V1 has been moved into the base class and is now available on all key/value config builders.~~)
61-
* Escaping Expanded Values - It is possible to xml-escape inserted values in ~~`Expand`~~`Token`(as of V3) mode now using the new [escapeExpandedValues](#escapeexpandedvalues) attribute.
62-
* Section Handlers - This feature allows users to develop extensions that will apply key/value config to sections other than `appSettings` and `connectionStrings`
63-
if desired. Read more about this feature in the [Section Handlers](docs/SectionHandlers.md) segment below.
30+
* ConfigBuilder Parameters from AppSettings - This has been one of the most asked for features of these config builders. With V2, it is now possible to read initialization parameters for config builders from `appSettings`. Read more about it [here](docs/KeyValueConfigBuilders.md#appsettings-parameters).
31+
* Lazy Initialization - As part of the work to enable pulling config parameters from `appSettings`, these key/value configuration builders now support a lazy initialization model. Things that must happen immediately can be left in the existing `Initialize(name, config)` method, or builders can leverage the new `LazyInitialize(name, config)` method for things that can happen just before retrieving values. All builders in this project have been updated to be lazy whenever possible.
32+
* Updateable Keys - Builders can now massage key names before inserting into config. The [AzureKeyVaultConfigBuilder](docs/KeyValueConfigBuilders.md#azurekeyvaultconfigbuilder) has been updated to use this feature to allow embedding 'version' tags in key names instead of applying a single 'version' tag to the builder. (Note: This is seperate from, and performed *after* prefix stripping.)
33+
* **[[Obsolete]] This has been superceded by the [enabled](docs/KeyValueConfigBuilders.md#enabled) tag.** (~~Base Optional Tag - The `optional` tag that some of the builders in this project employed in V1 has been moved into the base class and is now available on all key/value config builders.~~)
34+
* Escaping Expanded Values - It is possible to xml-escape inserted values in ~~`Expand`~~`Token`(as of V3) mode now using the new [escapeExpandedValues](docs/KeyValueConfigBuilders.md#escapeexpandedvalues) attribute.
35+
* Section Handlers - This feature allows users to develop extensions that will apply key/value config to sections other than `appSettings` and `connectionStrings` if desired. Read more about this feature in the [Section Handlers](docs/SectionHandlers.md) segment below.
6436

6537
## How to contribute
6638

docs/KeyValueConfigBuilders.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ actual secret file will be xml formatted - though this should be considered an i
149149
(If you need to share a secrets.json file with Core projects, you could consider using the `SimpleJsonConfigBuilder` below... but as with this
150150
builder, the json format for Core secrets is technically an implementation detail subject to change as well.)
151151

152-
There are three additional configuration attributes for this config builder:
152+
There are two additional configuration attributes for this config builder:
153153
* `userSecretsId` - This is the preferred method for identifying an xml secrets file. It works similar to .Net Core, which uses a 'UserSecretsId' project
154154
property to store this identifier. (The string does not have to be a Guid. Just unique. The VS "Manage User Secrets" experience produces a Guid.) With this
155155
attribute, the `UserSecretsConfigBuilder` will look in a well-known local location (%APPDATA%\Microsoft\UserSecrets\\&lt;userSecretsId&gt;\secrets.xml in
@@ -199,7 +199,7 @@ features.
199199
```xml
200200
<add name="AzureAppConfig"
201201
[@mode|@enabled="enabled"|@charMap|@prefix|@stripPrefix|tokenPattern|@escapeExpandedValues]
202-
(@endpoint="https://your-appconfig-store.azconfig.io" | @connectionString="Endpoint=https://your-appconfig-store.azconfig.io;Id=XXXXXXXXXX;Secret=XXXXXXXXXX")
202+
(@endpoint="https://your-appconfig-store.azconfig.io" | <del>@connectionString="Endpoint=https://your-appconfig-store.azconfig.io;Id=XXXXXXXXXX;Secret=XXXXXXXXXX"</del>)
203203
[@keyFilter="string"]
204204
[@labelFilter="label"]
205205
[@acceptDateTime="DateTimeOffset"]
@@ -214,8 +214,9 @@ features.
214214
wish to use this new service for managing your configuration, then use this AzureAppConfigurationBuilder. Either `endpoint` or `connectionString` are
215215
required, but all other attributes are optional. If both `endpoint` and `connectionString` are used, then preference is given to the connection string.
216216
* `endpoint` - This specifies the AppConfiguration store to connect to.
217-
* `connectionString` - This specifies the AppConfiguration store to connect to, along with the Id and Secret necessary to access the service. Be careful
218-
not to expose any secrets in your code, repos, or App Configuration stores if you use this method for connecting.
217+
* ~~`connectionString`~~ - The recommendation is to use `endpoint` in conjunction with [DefaultAzureCredential](#azure-config-builders). ~~This specifies
218+
the AppConfiguration store to connect to, along with the Id and Secret necessary to access the service. Be careful
219+
not to expose any secrets in your code, repos, or App Configuration stores if you use this method for connecting.~~
219220
* `keyFilter` - Use this to select a set of configuration values matching a certain key pattern.
220221
* `labelFilter` - Only retrieve configuration values that match a certain label.
221222
* `acceptDateTime` - Instead of versioning ala Azure Key Vault, AppConfiguration uses timestamps. Use this attribute to go back in time
@@ -234,7 +235,7 @@ required, but all other attributes are optional. If both `endpoint` and `connect
234235
[@preloadSecretNames="true"]
235236
type="Microsoft.Configuration.ConfigurationBuilders.AzureKeyVaultConfigBuilder, Microsoft.Configuration.ConfigurationBuilders.Azure" />
236237
```
237-
If your secrets are kept in Azure Key Vault, then this config builder is for you. There are three additional attributes for this config builder. The `vaultName`
238+
If your secrets are kept in Azure Key Vault, then this config builder is for you. There are four additional attributes for this config builder. The `vaultName`
238239
attribute (or `uri`) is required. Previous iterations of this config builder allowed for a `connectionString` as a way to supply credential information for connecting to
239240
Azure Key Vault. This method is no longer allowed as it is not a supported scenario for the current `Azure.Identity` SDK which is used for connecting
240241
to Azure services. Instead, this iteration of the config builder exclusively uses [DefaultAzureCredential](https://docs.microsoft.com/en-us/dotnet/api/azure.identity.defaultazurecredential)
@@ -296,7 +297,7 @@ begins with 'Simple.' Think of the backing json file as a basic dictionary, rath
296297

297298
(A multi-level heirarchical file can be used. This provider will simply 'flatten' the depth by appending the property name at each level using ':' as a delimiter.)
298299

299-
There are three additional attributes that can be used to configure this builder:
300+
There are two additional attributes that can be used to configure this builder:
300301
* `jsonFile` - A required attribute specifying the json file to draw from. The '~' character can be used at the start to reference the app root.
301302
* `jsonMode` - `[Flat|Sectional]`. 'Flat' is the default.
302303
- This attribute requires a little more explanation. It says above to think of the json file as a single flat key/value source. This is the usual that applies to

0 commit comments

Comments
 (0)