I am trying to setup Azure Feature Manager in my .net core api project. I have two flags setup in azure. One with 'Development' label and one without a label.
I am trying to retrieve only the feature flags with development label. But it returns me all two flags in azure. I am trying to figure out where I done something wrong. If anybody has any idea on how to fix this would be really helpful.
var settings = config.Build();
var connection = settings.GetConnectionString("AppConfig");
config.AddAzureAppConfiguration(options =>
options
.Connect(connection)
.UseFeatureFlags(opt => {
opt.Select(KeyFilter.Any, "Development");
}));
Code to retrieve all feature flags available.
var featureNames = _featureManager.GetFeatureNamesAsync();
await foreach (var name in featureNames)
{
var isEnabled = await _featureManager.IsEnabledAsync(name);
featureList.Add(new FeatureFlag()
{
Feature = name,
IsEnabled = isEnabled
});
}
Which returns,
Try it with the label property. (https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.configuration.azureappconfiguration.featuremanagement.featureflagoptions.label?view=azure-dotnet)
Like so: