extensions icon indicating copy to clipboard operation
extensions copied to clipboard

Microsoft.Extensions.Configuration.AzureTableStorage

Open hiraldesai opened this issue 7 years ago • 3 comments

Is your feature request related to a problem? Please describe.

I'm using Microsoft.Extensions.Configuration.AzureKeyVault for configuration in a rather large app that consists of multiple dotnet core apis, azure functions, and dotnet core websites. In order to be able to share the configuration across these multiple projects, we moved away from file based (appsettings.environment.json) to AzureKeyVault based configuration. Now our KeyVault is a combination of secret values and non-secret values, management/navigation through portal has become a bit challenging, and it also feels wrong to store all these "non-secret" values to AzureKeyVault.

Describe the solution you'd like

I would like to create Microsoft.Extensions.Configuration.AzureTableStorage that can use a table storage to store non-secret configuration values. It is slightly better than file based storage as it can be shared easily by multiple projects in the same solution and also multiple solutions for the same app can also share this without having to duplicate file based storage. It will basically work like this:

  1. Read StorageConnectionString (config key that consumers can override) from already built configuration

  2. Use ApplicationName (required, acts as table name for the storage), and PartitionKey (defaulted to "default" but consumer can override) that initializes like this:

            builder.ConfigureAppConfiguration((context, config) =>
            {
                var builtConfig = config.Build();
                var tableConfigurationBuilder = new ConfigurationBuilder();
                tableConfigurationBuilder.AddAzureTableStorage(builtConfig["StorageConnectionString"], "MyAppName");	// Other optional parameters as per above
                var tableConfig = tableConfigurationBuilder.Build();
                config.AddConfiguration(tableConfig);
            });
  1. Read all the rows from the provided table name by partition key from Azure table and convert them into keyvalue pair

Describe alternatives you've considered

I've considered file based alternatives but management overhead is too much.

Additional context

I will be writing this for one of my projects regardless of the approval of this feature request anyway. But I thought it's something that might be useful to the community as well. Please let me know what you think.

hiraldesai avatar Apr 02 '19 00:04 hiraldesai

Please let me know if the referenced PR is acceptable. I have not contributed to this repository before so let me know if I've missed anything.

hiraldesai avatar Apr 05 '19 00:04 hiraldesai

@hiraldesai Thanks for filing this, but as I said on the PR, this is something we already decided not to include here.

ajcvickers avatar Apr 18 '19 16:04 ajcvickers

No worries! I have published my own here in case if someone stumbles upon similar problem.

hiraldesai avatar Apr 18 '19 22:04 hiraldesai