I am using Azure Feature Filters with the Net Framework 4.8. I created a Targeting Feature Filter and entered 1 group name which I call from my application. It should return true if the group is found and false if not found. I followed this tutorial to create the flag and connection: https://docs.microsoft.com/en-us/azure/azure-app-configuration/quickstart-feature-flag-dotnet. And added a ContextualTargetingFilter:
services.AddSingleton<IConfiguration>(_configurationroot).AddFeatureManagement().AddFeatureFilter<ContextualTargetingFilter>();
Now when I call await GetFeatureToggleAsync("FeatureFlagName", GroupValue) it always returns true. I swear this worked last week and returned false when the groupvalue was not a match. What am I doing wrong?
public static async Task<bool> GetFeatureToggleAsync(string featureToggle, string group)
{
using (ServiceProvider serviceProvider = _services.BuildServiceProvider())
{
IFeatureManager featureManager =
serviceProvider.GetRequiredService<IFeatureManager>();
var context = new TargetingContext
{
Groups = new List<string>() { group }
};
return await featureManager.IsEnabledAsync(featureToggle, context);
}
}