Using Feature Flags with label and null label values cause dynamic response from the feature manager

Ivan Dobrynskyi 21 Reputation points
2021-07-30T10:42:21.23+00:00

Hi all, we had an issue with using feature flags.
We have a feature with the same name
We apply the code and expect to read all features and the labeled should always override the null labeled one.

   .UseFeatureFlags(featureFlagOptions =>  
                       {  
                           featureFlagOptions.Label = LabelFilter.Null;  
                       }).UseFeatureFlags(featureFlagOptions =>  
                       {  
                           featureFlagOptions.Label = label;  
                       })  

And as a result, we had a dynamic response from the feature manager with
During the first call, we had the label value, but then all the rest calls we had only null labeled values

Azure App Configuration
Azure App Configuration
An Azure service that provides hosted, universal storage for Azure app configurations.
238 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,931 questions
0 comments No comments
{count} votes

Accepted answer
  1. Ryan Hill 28,716 Reputation points Microsoft Employee
    2021-08-01T05:11:48.827+00:00

    Hi @Ivan Dobrynskyi ,

    I'm not certain why you're chaining the call like that, but I would do the following:

       // Augment the ConfigurationBuilder with Azure App Configuration  
       // Pull the connection string from an environment variable  
       configBuilder.AddAzureAppConfiguration(options => {  
           options.Connect(configuration["connection_string"])  
                  .Select("CustomFeature*", LabelFilter.Null)  
                  .Select("CustomFeature*", "label")  
                  .UseFeatureFlags();  
       });  
    

    This allows you to pull CustomFeature key value pairs along based on the feature flag it's associated with.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.