Appconfiguration: Support single-value arrays

Created on 25 Sep 2019  路  5Comments  路  Source: Azure/AppConfiguration

I have implemented a custom filter using the IFeatureFilter interface and one of the Feature Settings parameter is a string array. In the Azure portal if I assign multiple values for the parameter then the array will return the correct values in the .NET app but if I only have one value then the string array returns null

public enum EnvironmentFilterApplyMethod
{
    Allow,
    Block,
}

public class EnvironmentFilterSettings
{
    public EnvironmentFilterApplyMethod Method { get; set; }

    public string[] Environments { get; set; }
}

When the Azure Portal is configure like this then Environments will contain [Development, Integration]
image

If I only have one value as below then the value of Environments is null
image

FeatureManagement portal

Most helpful comment

It's actually unintended that it works when Environments is specified twice. Currently to write an array, you need to suffix with an index. E.g. Environments:0 Environments:1, etc.

@MSGaryWang perhaps we could improve this functionality so that we add UI support for making arrays intuitive?

All 5 comments

It's actually unintended that it works when Environments is specified twice. Currently to write an array, you need to suffix with an index. E.g. Environments:0 Environments:1, etc.

@MSGaryWang perhaps we could improve this functionality so that we add UI support for making arrays intuitive?

It's actually unintended that it works when Environments is specified twice. Currently to write an array, you need to suffix with an index. E.g. Environments:0 Environments:1, etc.

@MSGaryWang perhaps we could improve this functionality so that we add UI support for making arrays intuitive?

Thanks for that, I will try with the index suffix

Array support is what's preventing me from using this feature today. I'm really excited about this feature though so I'll keep an eye out for this to get completed so that I can refactor my app to use it eventually. But for now, the current handling of arrays just won't work for me due to 3rd party packages expecting an array of values. So while the suffix index works for individual retrieval, if I have a dependency that expects an array, it just breaks as it is today.

The user interface on the azure website is not intuitive when inputting array values. There are a few problems that need to be addressed.

  • The user interface should display the array elements together. Currently every element is shown on its' own line. Similar to how Keys with _same name_ but _different labels_ show up as indented.
  • The user interface should allow a user to input an array value when creating a new key. Currently we have to explicitly create every element of the array.
  • Related to the previous bullet, the user should not have to explicitly input the array index. Currently we have to explicitly declare the array index. ie: MyConfigArray:0

You can actually put arrays now. Please let us know if it works for you.

image

We treat all parameter values as JSON now, which means, besides the array, numbers stay as numbers, boolean stays as boolean and you can even put a JSON object.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xin9le picture xin9le  路  4Comments

kamalsivalingam picture kamalsivalingam  路  4Comments

yegu-ms picture yegu-ms  路  7Comments

funkysi1701 picture funkysi1701  路  7Comments

kamalsivalingam picture kamalsivalingam  路  3Comments