Get started with the flagd integrations
flagd is a feature flag evaluation engine that provides an OpenFeature-compliant backend for managing and evaluating feature flags in real-time. The Aspire flagd integration lets you model a flagd server as a first-class resource in your AppHost, then hand the connection information to any consuming app — regardless of language.
Why use flagd with Aspire
Section titled “Why use flagd with Aspire”Adding flagd through Aspire — rather than wiring up containers and connection strings by hand — gives you:
- Zero-config local development. Aspire runs flagd from the
ghcr.io/open-feature/flagdcontainer image with no manual container management required. - Consistent connection info across languages. Once you reference the flagd resource from a consuming app, Aspire injects connection properties as environment variables in a predictable format that works from C#, TypeScript, Python, Go, or any other language.
- Built-in health checks. The hosting integration automatically registers a health check against the flagd
/healthzendpoint so the dashboard and your orchestrator can tell when the server is ready. - Dashboard observability. The flagd resource shows up in the Aspire dashboard with logs and status alongside your other services.
- Multi-language OpenFeature clients. Any OpenFeature-compatible SDK with a flagd provider — C#, Go, Python, or TypeScript — works with the injected connection information.
How the pieces fit together
Section titled “How the pieces fit together”The flagd integration has two sides: a hosting integration that you use in your AppHost to model the flagd resource, and a connection story for consuming apps that reference it.
architecture-beta group apphost(server)[AppHost] group consumer(server)[Consuming app] service hosting(server)[Hosting integration] in apphost service flagd(server)[flagd server] in apphost service app(server)[App] in consumer hosting:R --> L:flagd flagd:R --> L:app
The hosting integration lives in your AppHost project and models the flagd server as a resource. Consuming apps reference it and use the connection information Aspire injects to evaluate feature flags via the OpenFeature SDK.
Getting there is a two-step process: model the flagd resource in your AppHost, then connect to it from each app that needs it.
-
Model flagd in your AppHost
Section titled “Model flagd in your AppHost”Add the flagd hosting integration to your AppHost, then declare a flagd resource and reference it from the apps that need feature flags. The flagd Hosting integration article walks through every capability — file-based flag sync, port customization, log levels, and health checks.
Set up flagd in the AppHost
-
Connect from your consuming app
Section titled “Connect from your consuming app”When you reference a flagd resource from a consuming app, Aspire injects its connection information as environment variables. See Connect to flagd for the connection properties reference and per-language examples for C#, Go, Python, and TypeScript — using the OpenFeature SDK and flagd providers.
Connect to flagd