Comments (10)
I put together a .NET 6 app using the code you provided, and it works for me.
Are you using any label for your feature flags?
from featuremanagement-dotnet.
Yes we are using Labels.
When adding a feature flag without a label and using LabelFilter.Null this works on an key which has no label.
However, as the code above has a label, this does not work.
from featuremanagement-dotnet.
@Vincentvwal does the "Tip" in step 2 of the doc below help?
from featuremanagement-dotnet.
I am seeing the same behavior where the flags work as expected, except that the cache never updates to see changes occurring. Is this possibly because in my Dev environment I am using a Free version of Azure App Configuration rather than a paid one? Does it disallow updates so that the 1000 daily requests aren't used too quickly?
Edit: I realized that I could simply point to the prod App Configuration really quickly, that did not resolve the issue. If it matters I have not updated to .Net 6 yet, but given that the original poster was seeing it in 6 that may not be pertinent.
from featuremanagement-dotnet.
@zhenlan while the tip did not really help, i did notice something in step 2 itself.
When using the feature flags as follows it does not refresh them
options.Connect("connectionstring")
.UseFeatureFlags(options => {
options.CacheExpirationInterval = TimeSpan.FromSeconds(5);
});
However, when doing it as follows it works
options.Connect("connectionstring")
.UseFeatureFlags(options => {
options.CacheExpirationInterval = TimeSpan.FromSeconds(5);
options.Select(KeyFilter.Any, "testlabel");
});
The key in this is the select filter in the UseFeatureFlags.
It will only refresh the keys if there is a keyselector in place.
If there is none, it will select the keys initially but never update them even when forcing it or changing the CacheExpirationInterval.
I don't know if this is indented behaviour?
@GWJYonder i'm guessing this is also your issue.
We are testing on the free tier as well.
from featuremanagement-dotnet.
Unfortunately that hasn't resolved my issue. At this point I have tried pretty much every combination I can think of:
- Just UseFeatureFlags with no options (which I believe should have been enough for a 30 second refresh of all of the keys with no labels).
- Setting just the CacheExpirationInterval
- 5 seconds and 30 seconds
- Solely performing the Select
- Performing both
- In each order because why not
- as separate lines and chained together because why not
- Gave all of my Feature Flags labels and filtered on the label.
- Added in a RefreshOptions call even though we aren't using key-value configurations, just Feature Flags
In all scenarios the service connected to App Configuration and got the initial values, but never updated after that.
from featuremanagement-dotnet.
@GWJYonder
The following example is fully working:
https://gist.github.com/Vincentvwal/de817710c816866ad481f5a5bc82ba58
The feature was created as follows
from featuremanagement-dotnet.
Thanks, that helped me resolve it. My Startup.Configure call looked like this:
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IApiVersionDescriptionProvider provider)
{
app.UseAzureAppConfiguration();
CurrentEnvironment = env;
if (env.IsDevelopment())
{...}
app.UseRouting();
app.UseCors();
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
});
app.UseCorrelationId();
}
I moved app.UseAzureAppConfiguration(); from the bottom of that method to the top and that resolved the issue. When I first added it in I was honestly a bit surprised it worked so low, but it did. I was not expecting partial functionality where the initial handshake and providers would work, and only the refreshes would fail.
Thanks for your help.
from featuremanagement-dotnet.
@Vincentvwal @GWJYonder glad it worked for you.
Just to answer/clarify a few questions along the way of this thread
- The dynamic configuration and feature flags work with the free tier Azure App Configuration.
- The
UseFeatureFlags
loads all feature flags with no labels by default. When labels are used, make sure you callFeatureFlagOptions.Select
to specify the label. - Azure App Configuration middleware refreshes the configuration and feature flags. To ensure the middleware is triggered, call the
app.UseAzureAppConfiguration()
method as early as appropriate in your request pipeline so another middleware won't bypass it in your app. To learn more, see Request-driven configuration refresh.
from featuremanagement-dotnet.
Looks like everything in this thread has been resolved. Closing.
from featuremanagement-dotnet.
Related Issues (20)
- ISessionManager is not mentioned in README
- Suggest to have app.UseFeatureManagement HOT 8
- Silent failure in TargetingTelemetryInitializer HOT 10
- The TargetingId should be included in the FeatureEvaluation event even if it's null/empty. HOT 4
- Targeting evaluation is CPU dependent. HOT 4
- Remove the support for variants and telemetry from the .NET feature flag schema HOT 14
- Include Targeting Information on outgoing telemetry HOT 2
- Support .NET 8 Targeting framework in Microsoft.FeatureManagement.Telemetry.ApplicationInsights.AspNetCore
- Target netstandard2.* in Microsoft.FeatureManagement.Telemetry.ApplicationInsights
- The approach to telemetry (using custom `ITelemetryPublisher`) seems overengineered and counter to modern OpenTelemetry abstractions HOT 37
- Add Default Http Targeting Context Accessor
- Consider moving `TargetingHttpContextMiddleware` to the App Insights package HOT 2
- No instance of ITargetingContextAccessor is available for variant assignment. HOT 6
- FeatureManagerSnapshot should snapshot TargetingContext as well
- EvaluationDataToApplicationInsights example
- Can't Set FeatureFilters In FeatureManager In .NET Framework Application HOT 7
- Update Package metadata
- Add a link to preview on main readme
- Cannot use the TargetingFilter in .NET class library project HOT 3
- Nuget "Microsoft.FeatureManagement.AspNetCore" Version 3.3.0 - Multiple feature filters match the configured filter named 'Microsoft.TimeWindow' HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from featuremanagement-dotnet.