Skip to content
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

Support single-value arrays #147

Closed
trevonmckay opened this issue Sep 24, 2019 · 9 comments
Closed

Support single-value arrays #147

trevonmckay opened this issue Sep 24, 2019 · 9 comments
Assignees
Labels
FeatureManagement portal Issues relating to the AppConfig portal.

Comments

@trevonmckay
Copy link

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

@jimmyca15
Copy link
Member

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?

@zhenlan zhenlan added FeatureManagement portal Issues relating to the AppConfig portal. labels Sep 25, 2019
@trevonmckay
Copy link
Author

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

@millicandavid
Copy link

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.

@loligans
Copy link

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

@zhenlan
Copy link
Contributor

zhenlan commented Apr 21, 2020

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.

@binkiesjoris
Copy link

This doesn't seem to work for Azure App Service configurations, I still have to use the index notation for this to be picked up. What would be required to apply this to an Azure App Service?

@jiayi11
Copy link

jiayi11 commented Jan 25, 2022

Hi @binkiesjoris
Could you help me understand what exactly doesn't work for you? What do your feature filters look like and how are you using App configurations with App Services?

@binkiesjoris
Copy link

binkiesjoris commented Jan 25, 2022

@jiayi11 sorry for the confusion. I am NOT using App configurations with App Services. I have a App Service with an application setting of type array and was wondering if the fix discussed in this issue also applied to application settings for an App Service. I.e. I have a setting defined like this in appsettings.json:
"x": { "y": [ "v1", "v2" ] }

and would like to use the "x:y" = "[v1, v2]" notation in the Configuration section of the Azure portal, but instead, I have to use "x:y:0" = "v1" and "x:y:1" = "v2" for it to work.

@jiayi11
Copy link

jiayi11 commented Jan 25, 2022

Hi @binkiesjoris This repo is for Azure App Configuration service and the thread is discussing feature filters. From your response you might be looking to reach App Service team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FeatureManagement portal Issues relating to the AppConfig portal.
Projects
None yet
Development

No branches or pull requests

7 participants