Using FeatureFlags.app: The Easy Life

Managing feature flags from a central server is more powerful than hardcoding values in appsettings.json. If you want a flag management server ready to go, featureflags.app is free to try. The FeatureFlags.app client library connects your application, so you can update flags without touching configuration files or redeploying your app.

Installation

Add the Acmi.FeatureFlags.Client NuGet package to your project:

dotnet add package Acmi.FeatureFlags.Client

Then register it in your application. The client provides an extension method on IHostApplicationBuilder. In Program.cs:

using Acmi.FeatureFlags.Client;

...

builder.AddFeatureFlags();

That registers the necessary services, including IFeatureManager, in your dependency injection container.

Configuration

The client needs to know where to find the feature flag API, and how to authenticate. Add the endpoint URL and API key to your appsettings.json:

{
    "FeatureFlags": {
        "ApiBaseEndpoint": "https://featureflags.app/api/",
        "ApiKey": "[from secrets]",
        "CacheExpirationInMinutes": 15
    }
}

The client fetches flag definitions at startup, then refreshes them in the background every CacheExpirationInMinutes.

Checking Flags

Inject IFeatureManager wherever you need to check flags:

public class ProductController : Controller
{
    private readonly IFeatureManager _featureManager;

    public ProductController(IFeatureManager featureManager)
    {
        _featureManager = featureManager;
    }

    public async Task<IActionResult> Index()
    {
        if (await _featureManager.IsEnabledAsync("NewProductPage"))
        {
            return View("NewProductPage");
        }
        return View("ProductPage");
    }
}

The interface is the same as Microsoft.FeatureManagement, so switching between local configuration and remote management doesn’t require changing your flag-checking code. This example shows IFeatureManager, but feature management attributes and tag helpers work out of the box too.

Clearing the Cache

The client keeps flag values in memory and refreshes them in the background, so it doesn't hammer the remote API on every request. Changes reach your application within the refresh interval (15 minutes by default). To refresh now, inject IFeatureFlagClient and call ClearCache().

In production, a longer interval reduces load on the flag server, but apps that rely on kill-switch flags should use a shorter one.

Why Remote Flags?

Storing flag values in appsettings.json works for simple scenarios, but it has limits. Changing a flag requires a configuration update and often a restart. There’s no audit trail. There’s no UI. Multiple services can’t share flag definitions easily.

A central flag management server solves all of that. You update a flag in one place, and every connected application picks it up within its refresh interval. You can see the history of changes, who made them, and when. Non-developers can manage flags through a web UI without touching code or config files. The Acmi.FeatureFlags.Client library is the bridge between your application and that centralized control.

For more, see the FeatureFlags.app README or just ask your favorite AI.

Configure once. Control everywhere. Sleep slightly better.

Try It in Your App

FeatureFlags.app is a hosted dashboard for Microsoft.FeatureManagement. The Quick Start adds it to your ASP.NET Core application in about five minutes.