Coder Social home page Coder Social logo

azure / appconfiguration Goto Github PK

View Code? Open in Web Editor NEW
221.0 38.0 66.0 2.32 MB

Questions, feedback and samples for Azure App Configuration service

License: MIT License

appconfig appsettings configuration configuration-management azure-services azure config azure-app-configuration

appconfiguration's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

appconfiguration's Issues

Invalid JSON could also be imported

Our current JSON Parser allows importing invalid Json.

Valid JSON:
{ "key": "value" }

Invalid JSON that we still imports successfully:
{ "key" : value }
{ "key" : }
{ key }
{ : }

We should add a validator before our JSON parser starts parsing.

Portal: after user types in an existing label, he must select again, otherwise reverts to Empty

When user creates a new KV on Portal, after he/she types in an existing label, the user must select the label again with mouse, otherwise the label would revert to Empty by default, hence causing user miss-config potentially.

  1. User types in an existing label, now he/she must select again with mouse:

image

  1. Otherwise it would revert to Empty:

image

Imaging the user types in "L1" and click "Apply" immediately, we would create a new KV with empty label.

Search should not be case-sensitive

Search by key should be not case-sensitive. Assumption should be that when a search by a pattern is performed it's likely because one doesn't remember the exact key or casing.

Provide a Consul compatible API

Consul is a great open source, platform agnostic offering that is popular with many folks. In the same vein as the Cassandra API capability provided by Cosmos DB it would be great if App Configuration provided a Consul compatible API so existing (or new) app components could leverage Consul clients but benefit from the backend power of App Configuration.

Add a section in all quickstart docs to suggest to use Managed Identity

We can suggest users that connecting through managed identity to ACH is supported if their application is deployed to other managed identity supported Azure services such as App Service, VM, Azure Container Instance etc. We can include a link to the doc that discusses our managed identity support in more detail.

Importing performance

Currently importing takes 1min for every 500 KVs, which is a bit long for people in front of monitors. Potential performance improve?

Experiments:
10 -> 2s
100 -> 10s
200 -> 23s
500 -> 1min
1000 -> 2min

.NET Core provider: Selecting only empty label key-values is unclear.

Some of the key-values in my configuration store's have multiple labels. For example I have the key-value "abc" which exists with an empty label and also with a label named "someLabel".

I wanted to use the .NET Core config provider to query the key-values with an empty label. For some reason I was expecting key-values with a null label to always take priority. What I found was that when I accessed configuration["abc"] it returned the value of the abc key-value in the "someLabel" label.

Then I tried to figure out how to query only empty label key-values with the provider but it wasn't as easy as I would have liked. I need to call

            builder.AddAzconfig(o => {
                o.ConnectWithManagedIdentity("https://mystore.azconfig.io");
                o.Use("*", "\0"); // This selects key-values with the empty label.
            });

I believe we need to make the empty label filter a constant within the provider and perhaps add documentation to the method which describes that this constant should be used to select only key-values that have the empty label.

Docs: MSI integration for different frameworks

In the Quickstarts sections there are five pages each for different frameworks. At the end of every page there is a link to msi integration tutorial, which only shows how to do that for DotNet Core provider. https://review.docs.microsoft.com/en-us/azure/app-configuration-hubs/quickstart-dotnet-app?branch=pr-en-us-63864#next-steps
There should be different pages for DotNet Full framework builder and Java spring.

Also in https://review.docs.microsoft.com/en-us/azure/app-configuration-hubs/integrate-azure-managed-service-identity?branch=pr-en-us-63864#configure-your-app-to-use-a-managed-identity since ConnectWithManagedIdentity method will take an endpoint as parameter, we should change the example setting name from ConnectionStrings:AzureAppConfig to Endpoint:AzureAppConfig for instance.

Failed to watch a non-existing key in a Java spring app

I got the error below when watching (spring.cloud.azure.config.stores[0].watched-key) for changes of a not-yet-created key.

java.lang.IllegalStateException: Failed to load keys from Azure Config Service. With status code: 416, response: HttpResponseProxy{HTTP/1.1 416 Range Not Satisfiable

All 3 scenarios below should be considered as valid

  1. A watched key does not exist and it is created after the app started
  2. A watched key is an existing key and its value is changed after the app started
  3. A watched key is an existing key and it is deleted after the app started

Portal: add "at time" label above time fields

On portal, when I was doing key value comparison, I was confused with time option since there is no text explaining what the field is. I would recommend adding text such as "at time" above the time field so that new user could figure out what the field represents for.

.NET Core provider: The preferred date time feature may throw an invalid header exception for some cultures

The preferred date time feature of the AzureAppConfiguration configuration provider formats date times using the current thread culture and tries to add this formatted date to an HTTP header. This causes cultures such as japanese that use non-ASCII characters to represent the current day to throw an HttpRequestException ("Request headers must contain only ASCII characters.")

Repro

private static void Repro()
{
    var builder = new ConfigurationBuilder();

    CultureInfo cu = new CultureInfo("ja-JP");
    Thread.CurrentThread.CurrentCulture = cu;

    builder.AddAzureAppConfiguration(o =>
        o.Connect(connectionString)
        .Use("*", preferredDateTime: new DateTimeOffset(2019, 2, 28, 19, 0, 0, TimeSpan.FromHours(9))) // This selects key-values with the empty label.);
    );

    IConfiguration config = builder.Build();
}

Workaround

//
// There is a bug with preferredDateTime and certain cultures such as Japanese
// The work-around is to set the current thread's culture to english when building the configuration
private static void WorkAround()
{
    var builder = new ConfigurationBuilder();

    builder.AddAzureAppConfiguration(o =>
        o.Connect(connectionString)
        .Use("*", preferredDateTime: new DateTimeOffset(2019, 2, 28, 19, 0, 0, TimeSpan.FromHours(9))) // This selects key-values with the empty label.);
    );

    //
    // Cache current culture to restore it
    var oldCulture = Thread.CurrentThread.CurrentCulture;

    //
    // Use an english culture to work around bug in preferred datetime and non-english cultures
    Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");

    //
    // Build the configuration, this causes the error in affected cultures
    IConfiguration config = builder.Build();

    //
    // Restore the previous culture
    Thread.CurrentThread.CurrentCulture = oldCulture;
}

Error in docs.microsoft for add package reference

Following the instructions in https://docs.microsoft.com/en-us/azure/azure-app-configuration/quickstart-dotnet-core-app, when doing:

dotnet add package Microsoft.Extensions.Configuration.AzureAppConfiguration

I get the following error:

info : Adding PackageReference for package 'Microsoft.Extensions.Configuration.AzureAppConfiguration' into project 'D:\repos\work\work.csproj'.
log  : Restoring packages for D:\repos\work\work.csproj...
info :   CACHE https://api.nuget.org/v3-flatcontainer/microsoft.extensions.configuration.azureappconfiguration/index.json
error: Unable to find a stable package Microsoft.Extensions.Configuration.AzureAppConfiguration with version
error:   - Found 1 version(s) in nuget.org [ Nearest version: 1.0.0-preview-007830001 ]
error:   - Found 0 version(s) in Microsoft Visual Studio Offline Packages
error:   - Found 0 version(s) in CliFallbackFolder
error: Package 'Microsoft.Extensions.Configuration.AzureAppConfiguration' is incompatible with 'all' frameworks in project 'D:\repos\work\work.csproj'.

My dotnet version is 2.1.504

The way to make it work is to explicitly add the version that is defined in NuGet:

dotnet add package Microsoft.Extensions.Configuration.AzureAppConfiguration --version 1.0.0-preview-007830001

While the package is in preview, there could be a side note in the documentation explaining that the version needs to be explicitly set and that they can get it from NuGet directly, or something like that.

FYI @zhenlan @drago-draganov

ASP.NET builder dependencies mismatch

The current version of asp.net builder (1.0.0-preview10124) has a dependency of Microsoft.Configuration.ConfigurationBuilder.Base(>=1.0.0-preview10124)

image

But when we built the project, it will throw an ConfigurationErrorException complaining about the ConfigurationBuilder.Base version to be at least 2.0.0. Also there is no 1.0.0-preview10124 but 2.0.0-preview10124 version for ConfigurationBuilder.Base, so maybe there is a typo about the version number in the builder?

Also we should remove the dependencies requirement for Azconfig.Client and Azconfig.ManagedIdentityConnector since we won't release these two packages.

Docs: some confusion points with MSI doc part of "Add a managed identity to your App Service"

Contents from doc (https://review.docs.microsoft.com/en-us/azure/app-configuration-hubs/integrate-azure-managed-service-identity?branch=pr-en-us-63864#configure-your-app-to-use-a-managed-identity)
"Add a managed identity to your App Service
To set up a managed identity in the portal, you will first create an application as normal and then enable the feature.
1 Create an app in the Azure portal as you normally would. Navigate to it in the portal.

2 Scroll down to the Settings group in the left navigation and select Identity.

3 Within the System assigned tab, switch Status to On and click Save."

Some suggestions,

  1. Step one is somehow hard for a new user if he or she needs to do search and find a way to do it, providing a sample link will be helpful.
  2. Step two and three could include screen shots in case people will be on the right track.

Docs:ASP.NET quick start doc incomplete instructions

  1. Under Create a .NET Framework console app project section:
    https://review.docs.microsoft.com/en-us/azure/app-configuration-hubs/quickstart-dotnet-app?branch=pr-en-us-63864#create-a-net-framework-console-app-project

When creating a .Net Console App, we should choose Visual C# > Windows Desktop instead of Visual C# > Windows Classic Desktop in visual studio 2017.
Also we should add comments that the builder requires .Net framework version 4.7.1 and up.

  1. Under Add App Configuration Hubs to app section
    https://review.docs.microsoft.com/en-us/azure/app-configuration-hubs/quickstart-dotnet-app?branch=pr-en-us-63864#add-app-configuration-hubs-to-the-app

There is a typo for the type in configBuilder, it should be
<add name="MyConfigStore" mode="Greedy" connectionString="${ConnectionString}" type="Microsoft.Configuration.ConfigurationBuilders.AzconfigBuilder, Microsoft.Configuration.ConfigurationBuilders.Azconfig" />
Also we may consider adding the configurations for environment variable builder as examples.

CLI: Unexpected error message when store doesn't exist.

I tried to list revisions of a configuration store with the CLI and I happened to type in the wrong name for my configuration hub. The CLI replied with the following error:

Cannot find connection-string of the configuration hub jimmyca-wcus.

I found this slightly odd because it makes it seem like the CLI is having trouble accessing my hub, when in reality the hub I specified did not exist. I would have expected a message such as

Cannot find the app configuration hub 'jimmyca-wcus'..

Duplicate Keys with different Labels

If I add two entries with the same Key but different value and Label, I am not able to access these duplicate Keys from the .Net Core App/Azure Function.

What is the use of Label? Is this similar to Version?
If that is the case, still shouldn't all the Keys with different values still be accessible?

Portal: Import/Export: Should the import operation block any further imports?

When the import operation starts, the import/export blade is disabled for the duration of the operation. However, if you go to another blade and then back the import/export blade is enabled and you can perform another import operation. This seems a bug to me, if we are disabling the blade we should not allow for another operation. Also, this is likely to be a source of race conditions.

image

Add "clear filters"

After user specified a filter, if he wants to remove filters and see current config, he must refresh the entire Web page, or click another section in Portal and come back again:

image

It would be great if we have a "clear filter" button that removes filters, so that user could check current config easily without refreshing the whole page.

Future of VSTS Variables

We have been using VSTS Variables heavily to store configuration for some of our microservices.
There is a huge limitation that when a configuration is incorrect, we would have to redeploy the microservice, since VSTS variables are tightly coupled with deployment.

We see a huge breakthrough with App Configuration. How do we manage configuration across different environments like QA/UAT/Production?

Also with App Configuration in place, what is the future of VSTS variables?

Add using statements to C# example in docs.microsoft

Following the instructions in https://docs.microsoft.com/en-us/azure/azure-app-configuration/quickstart-dotnet-core-app, when doing step #3 of Connect to app configuration store, it will be good to also point out that the user needs to add the corresponding using statement in the file, for the application to compile.

By just following the instructions, the user will get the error:

Program.cs(9,31): error CS0246: The type or namespace name 'ConfigurationBuilder' could not be found (are you missing a using directive or an assembly reference?) [...]

Build FAILED.

Program.cs(9,31): error CS0246: The type or namespace name 'ConfigurationBuilder' could not be found (are you missing a using directive or an assembly reference?) [...]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:02.20

According to the extensions installed in the code editor the user could see this, although being explicit about it might be better.

Docs (Design): Should the key "label" be changed to "version"?

The fact that we need to use "version" to explain what a label is seems to indicate it should be called version.

image

Label is quite confusing, it seems more like "tag" โ€ฆ observe the docs

image

In the meantime, for consistency, the docs should read "Versioning with labels" (we fixed this for the portal extension in the Azure Gallery).

Offline Cache

We are building many microservices that might depend on Service Registry based Key Value Store. We originally thought of using either Consul from HashiCorp or use VSTS as the store since it has release variables.
However We are now thinking of using AppConfiguration for that purpose.,
Since this is going to be central configuration store, we do not want our services go kaboom when the AppConfiguration goes down for any odd reason.
I do see SetOfflineCache method. I am not sure if it is for this purpose of caching the values as a backup?

Are there any examples for SetOfflineCache?

ASP.NET builder swallow exception flag "optional" doesn't work

Regardless of the value of optional, exceptions are swallowed.
<add name="MyConfigStore" mode="Greedy" labelFilter="l1*" optional="false" connectionString="wrongstring" type="Microsoft.Configuration.ConfigurationBuilders.AzconfigBuilder, Microsoft.Configuration.ConfigurationBuilders.Azconfig" />

For example, when we use a wrong connection string, or in labelFilter it contains "*" or "," which we shouldn't support, even if we set optional to be false it still swallow all exceptions.

Also based on doc https://github.com/aspnet/MicrosoftConfigurationBuilders#optional the default value of optional is true, should we change it to false as in DotNet Core provider?

Portal: Bulk Delete Configuration

How does one delete config keys in bulk? Or clear/reset the entire config store?
I tried importing a blank file but it did not work.
Can we have a documented way to do this either via portal or REST API?

"Compare" shows partial key-values

When user compare two configuration hubs, the page would list ALL key-values, which has two problems when KV number > 500 :

  1. page & operations become very laggy
  2. user needs to scroll all the way down to find the keys with different value

image

user has to scroll to very bottom to see every different key-values:

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.