A comprehensive example demonstrating how to use Fig for configuration management in .NET applications. This solution showcases Fig's powerful features through a sample Weather API built with .NET Aspire.
- Clone the repository
- Start the app host
- Click the Fig Web in the aspire dashboard
- Log in with 'admin' and 'admin'
- Change / update some settings
- Navigate to the swagger page for the weather api and validate that settings have changed

An example of how the dashboard will look
See detailed for detailed steps.
Fig is a dynamic configuration management system that enables real-time configuration updates without application restarts. For complete documentation, visit figsettings.com.
A REST API that provides weather forecast data with fully configurable behavior through Fig. Demonstrates real-time configuration updates affecting API responses without requiring restarts or redeployments. Data is all mocked.
Orchestrates the application stack including:
- Fig API service (backend configuration API) (via docker)
- Fig Web interface (configuration management UI) (via docker)
- WeatherApi service with Fig integration
Contains shared service configuration and telemetry setup for the distributed application.
Integration test suite demonstrating how to test Fig-enabled applications using in-memory configuration.
Settings are organized into logical categories with custom colors:
- General - Core application settings (Location, ForecastDays)
- Display - UI/output formatting options (TemperatureUnit, DescriptionStyle)
- Temperature Range - Operational constraints (MinTemperature, MaxTemperature)
- API Integration - External service configuration (ApiKey, ApiBaseUrl, Caching)
Multiple validation approaches showcased:
- Attribute-based validation -
[ValidateIsBetween],[ValidValues],[Validation(ValidationType.NotEmpty)] - Custom validation logic - Complex rules in
GetValidationErrors()method - Cross-field validation - Ensuring MinTemperature < MaxTemperature
- Secrets Management -
[Secret]attribute for sensitive data like API keys - Conditional Settings -
[DependsOn]for conditional visibility (CacheDurationMinutes only shown when EnableCaching is true) - Multi-line Input -
[MultiLine]attribute for longer text fields - Enum Support -
[ValidValues(typeof(TEnum))]for strongly-typed options - External Documentation - Settings reference external markdown documentation (
$weather-api) - Secret Providers - Supports Docker Secrets and DPAPI for secure credential storage
- Real-time Updates - Configuration changes instantly affect application behavior
- Integration Testing - In-memory configuration for isolated testing
Example of how documentation can be drawn from a markdown file
Example of how Fig can display the status of a health check
- .NET 10 SDK
- Docker Desktop / Docker hosting solution like WSL (for Fig API and Web containers)
- Clone the repository:
git clone https://github.com/mzbrau/fig-quick-start.git
cd fig-quick-start- Navigate to the solution directory:
cd src/Fig.QuickStart- Run the AppHost to start all services:
dotnet run --project Fig.QuickStart.AppHostThe .NET Aspire dashboard will open automatically, showing:
- Fig Web - Configuration management UI
- Fig API - Backend configuration service
- WeatherApi - Sample API with Fig integration
- Access the services:
- Fig Web UI:
http://localhost:7148 - WeatherApi: Check Aspire dashboard for assigned port
- Aspire Dashboard:
http://localhost:15225(or as shown in console)
- Open Fig Web UI at
http://localhost:7148 - Navigate to the WeatherApi client
- Modify settings like Location, ForecastDays, or TemperatureUnit
- Call the WeatherApi endpoint and observe immediate changes
- No restart required!
cd src/Fig.QuickStart
dotnet test Fig.QuickStart.WeatherApi.Testfig-quick-start/
├── docs/
│ └── weather-api.md # Configuration documentation
├── src/
│ └── Fig.QuickStart/
│ ├── Fig.QuickStart.AppHost/ # .NET Aspire orchestration
│ ├── Fig.QuickStart.ServiceDefaults/ # Shared service configuration
│ ├── Fig.QuickStart.WeatherApi/ # Sample API with Fig
│ └── Fig.QuickStart.WeatherApi.Test/ # Integration tests
└── README.md- Fig Repository: github.com/mzbrau/fig
- Documentation: figsettings.com
- API Documentation: docs/weather-api.md
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.