Introduction
Fig is a complete solution for managing settings across .NET microservices. Applications register a strongly typed settings class through the Fig.Client NuGet package. The Fig API stores those settings, and the Fig web application is where operators view, edit, and audit them.
Want an AI coding assistant to wire Fig into your app? Copy the prompt from Add Fig with AI and paste it into Cursor, Copilot, Claude Code, or similar.
A Fig 2.0-era product walkthrough is on the Videos page. The integration steps on this page reflect the current client API.
Quick Start
Pick the path that matches how you want to run Fig:
- Fastest — clone the fig-quick-start repository. It is an Aspire host with Fig API, Fig Web, and a sample application.
- Already using Aspire — add Fig to your AppHost with the Aspire integration.
- Docker Compose — the compose file in the Fig repository deploys Fig API, Fig Web, and Fig MCP against SQL Server. It is a full deployment, not a one-command local demo.
Docker Compose
- Copy
.env.exampleto.envin the repository root and setfqdn,SA_PWD,FIG_DB_PWD, and the other required values. Optionally setFIG_MCP_PASSWORDif you want the MCP container to start authenticated. - From the repository root, run
docker compose up. - Open Fig Web at
http://localhost:7148and log in with useradmin/ passwordadmin. Change that password before exposing Fig Web beyond a local machine.
The API listens on http://localhost:7281. Compose maps API 7281:8080 and Web 7148:80.
Integrate a client
The same steps apply to a new or existing ASP.NET Core project.
- Create a project if you need one:
dotnet new webapi
-
Add Fig.Client. Add a secret provider package for production.
-
Create a settings class that extends
SettingsBase. Put the Fig client name onFigOptions, not on this class:
using Fig.Client;
using Fig.Client.Abstractions.Attributes;
public class Settings : SettingsBase
{
public override string ClientDescription => "Example service settings";
[Setting("My favourite animal")]
public string FavouriteAnimal { get; set; } = "Cow";
[Setting("My favourite number")]
public int FavouriteNumber { get; set; } = 66;
[Setting("True or false, your choice...")]
public bool TrueOrFalse { get; set; } = true;
}
- Register Fig as a configuration provider in
Program.cs. Fig should be the last competing provider so it wins overappsettings.json.
using Fig.Client.ExtensionMethods;
var builder = WebApplication.CreateBuilder(args);
var loggerFactory = LoggerFactory.Create(b => b.AddConsole());
builder.Configuration
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
.AddFig<Settings>(options =>
{
options.ClientName = "ExampleService";
options.LoggerFactory = loggerFactory;
options.CommandLineArgs = args;
// Production: options.ClientSecretProviders = [new DockerSecretProvider(), new DpapiSecretProvider()];
options.ClientSecretOverride = "be633c90-4744-48c3-82c4-7045b2e172d5"; // development only
});
builder.Services.Configure<Settings>(builder.Configuration);
builder.Host.UseFig<Settings>();
UseFig<T>() registers Fig host workers (health, restart, custom actions, lookups). Do not call separate UseFigValidation / UseFigRestart APIs — they are obsolete.
-
Inject
IOptionsMonitor<Settings>where the application should receive live updates. -
Set
FIG_API_URIto the Fig API address:
FIG_API_URI=http://localhost:7281
Comma-separated addresses are supported; the first reachable address is used for the process lifetime. Unset FIG_API_URI (or pass --disable-fig=true) to run without Fig.
- Provide a client secret. Prefer a secret provider in production.
ClientSecretOverrideis for local development only.
See the examples in the source repository and Client Configuration for options, CLI flags, and offline modes.
Packages
| Package | Use |
|---|---|
| Fig.Client | Add this to applications that Fig should manage |
| Fig.Client.Abstractions | Attributes and contracts for libraries that must not take a full client dependency |
| Fig.Client.Testing | Integration tests and display-script tests |
| Fig.Aspire | Aspire AppHost helpers for Fig API and Fig Web |
| Secret providers | Docker, DPAPI, Azure, AWS, Google |
Fig MCP is a standalone container/app, not a client NuGet package. See the Fig MCP Server and the full package list.