You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{
// Define feature flags in config file
"FeatureManagement": {
"FeatureT": true, // On feature
}
}
Having this code:
var configurationBuilder2 = new ConfigurationBuilder();
configurationBuilder2.AddJsonFile("featureFlags.json");
IConfiguration featureFlagsConfig = configurationBuilder2.Build();
var featureManagementProvider = new FeatureManagementProvider(featureFlagsConfig);
await OpenFeature.Api.Instance.SetProviderAsync(featureManagementProvider);
var client = OpenFeature.Api.Instance.GetClient();
var feature = await client.GetBooleanValue("FeatureT", false);
Basically, we have a lot of boolean flags, which doesn't make sense to introduce that kind of structure per each.
But perhaps I'm missing something.
This if just a first step to migrate from FeatureManagement to OpenFeature, before connecting with third party provider.
Any hints ?
The text was updated successfully, but these errors were encountered:
toddbaert
changed the title
Cannot make this work with On/Off features declaration
Cannot make FeatureManagement provider work with On/Off features declaration
Aug 22, 2024
Guessing the issue might be with handling anything other than boolean, however, I workaround it by implementing a custom FeatureManager that injects IFeatureManager and implements just GetBoolean method, since it's the only feature we need for now.
It likely has to do with the fact that FeatureManagement was originally only designed to support Boolean checks.
The reason this implementation works is due to a still not fully released feature for what they call "Variants".
I'm thinking it should be a simple adjustment to allow for the simpler flags, but it would only work for boolean values since that's the only thing you can do without variants.
Hi,
I'm encountering an issue with having the OpenFeature / FeatureManagement provider to work with the On/Off features declaration:
https://learn.microsoft.com/en-us/azure/azure-app-configuration/feature-management-dotnet-reference?pivots=stable-version#onoff-declaration
featureFlags.json
Having this code:
It always evaluates fo false.
But when provided with this code:
It works fine.
Basically, we have a lot of boolean flags, which doesn't make sense to introduce that kind of structure per each.
But perhaps I'm missing something.
This if just a first step to migrate from FeatureManagement to OpenFeature, before connecting with third party provider.
Any hints ?
The text was updated successfully, but these errors were encountered: