BellaBaxter.AspNet.Configuration
0.1.1-preview.36
dotnet add package BellaBaxter.AspNet.Configuration --version 0.1.1-preview.36
NuGet\Install-Package BellaBaxter.AspNet.Configuration -Version 0.1.1-preview.36
<PackageReference Include="BellaBaxter.AspNet.Configuration" Version="0.1.1-preview.36" />
<PackageVersion Include="BellaBaxter.AspNet.Configuration" Version="0.1.1-preview.36" />
<PackageReference Include="BellaBaxter.AspNet.Configuration" />
paket add BellaBaxter.AspNet.Configuration --version 0.1.1-preview.36
#r "nuget: BellaBaxter.AspNet.Configuration, 0.1.1-preview.36"
#:package BellaBaxter.AspNet.Configuration@0.1.1-preview.36
#addin nuget:?package=BellaBaxter.AspNet.Configuration&version=0.1.1-preview.36&prerelease
#tool nuget:?package=BellaBaxter.AspNet.Configuration&version=0.1.1-preview.36&prerelease
BellaBaxter.AspNet.Configuration
ASP.NET Core IConfiguration provider that polls Bella Baxter for secrets
and hot-reloads them into your app — no restart required.
Works with any .NET app that uses IConfiguration: ASP.NET Core, Worker Service, console apps.
Installation
dotnet add package BellaBaxter.AspNet.Configuration
Quickstart
appsettings.json (non-secret config — safe to commit):
{
"BellaBaxter": {
"BaxterUrl": "https://api.bella-baxter.io",
"EnvironmentSlug": "production",
"PollingInterval": "00:01:00"
}
}
Program.cs:
var builder = WebApplication.CreateBuilder(args);
// Step 1 — Add Bella secrets as an IConfiguration source
// Reads BaxterUrl + EnvironmentSlug from appsettings.json
// Reads ApiKey from BELLA_BAXTER_API_KEY env var or BellaBaxter__ApiKey
builder.Configuration.AddBellaSecrets();
// Step 2 — Register source-generated typed class in DI (optional)
builder.Services.AddBellaTypedSecrets<BellaAppSecrets>();
// Step 3 — Inject anywhere (typed class, IConfiguration, IOptions<T>)
app.MapGet("/", (BellaAppSecrets s) => Results.Ok(new { s.Port, s.DatabaseUrl }));
app.MapGet("/raw", (IConfiguration config) => Results.Ok(config["DATABASE_URL"]));
Credentials — never in appsettings.json:
| Method | How |
|---|---|
bella exec -- dotnet run (recommended for local dev) |
Injects BELLA_BAXTER_API_KEY + BELLA_BAXTER_URL automatically |
| .NET User Secrets | dotnet user-secrets set "BellaBaxter:ApiKey" "bax-..." |
| Environment variable | BellaBaxter__ApiKey=bax-... |
Explicit configuration
builder.Configuration.AddBellaSecrets(o =>
{
o.BaxterUrl = "https://api.bella-baxter.io";
o.EnvironmentSlug = "production";
o.ApiKey = Environment.GetEnvironmentVariable("BELLA_BAXTER_API_KEY")!;
o.PollingInterval = TimeSpan.FromSeconds(30);
o.FallbackOnError = true; // keep serving cached secrets if Baxter is temporarily unreachable
});
How it works
- On startup:
GET /api/v1/environments/{slug}/secrets→ loads all secrets intoIConfiguration - Every
PollingInterval:GET /api/v1/environments/{slug}/secrets/version(lightweight version check) - If version changed: fetches full secrets → calls
OnReload()→ triggersIOptionsMonitor<T>.OnChange() IConfiguration["MY_SECRET"]always reflects the latest value
Baxter serves secrets from a Redis HybridCache — polling does not hit your cloud provider (AWS/Azure/GCP/Vault) on every request. Cloud costs stay near zero regardless of polling frequency.
Typed secrets with source generator
Combine with BellaBaxter.SourceGenerator for compile-time type safety:
// Injected via DI — typed, IDE-friendly, no magic strings
app.MapGet("/", (BellaAppSecrets s) => new {
s.DatabaseUrl, // string
s.Port, // int
s.FeatureFlag, // bool
});
See the samples for complete working examples.
__ double underscore = section separator
.NET's IConfiguration maps __ to : in key names:
| Bella secret key | IConfiguration path |
|---|---|
DATABASE_URL |
config["DATABASE_URL"] |
ConnectionStrings__Default |
config["ConnectionStrings:Default"] |
Jwt__Secret |
config["Jwt:Secret"] |
This means builder.Services.Configure<JwtOptions>(config.GetSection("Jwt")) maps directly to your Jwt__* secrets.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- BellaBaxter.Client (>= 0.1.1-preview.36)
- Microsoft.Extensions.Configuration (>= 10.0.5)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.5)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.5)
- Microsoft.Extensions.Http (>= 10.0.5)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.5)
- Microsoft.Extensions.Options (>= 10.0.5)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on BellaBaxter.AspNet.Configuration:
| Package | Downloads |
|---|---|
|
BellaBaxter.Aspire.Configuration
Aspire AppHost integration for Bella Baxter — inject Baxter API connection into Aspire-hosted apps. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.1-preview.36 | 40 | 3/30/2026 |
| 0.1.1-preview.35 | 33 | 3/30/2026 |
| 0.1.1-preview.34 | 31 | 3/30/2026 |
| 0.1.1-preview.33 | 34 | 3/30/2026 |
| 0.1.1-preview.32 | 35 | 3/30/2026 |
| 0.1.1-preview.31 | 38 | 3/30/2026 |
| 0.1.1-preview.30 | 44 | 3/27/2026 |
| 0.1.1-preview.29 | 38 | 3/27/2026 |
| 0.1.1-preview.28 | 30 | 3/27/2026 |
| 0.1.1-preview.27 | 33 | 3/27/2026 |
| 0.1.1-preview.26 | 34 | 3/26/2026 |
| 0.1.1-preview.23 | 39 | 3/26/2026 |
| 0.1.1-preview.22 | 36 | 3/26/2026 |
| 0.1.1-preview.21 | 37 | 3/26/2026 |
| 0.1.1-preview.20 | 31 | 3/26/2026 |
| 0.1.1-preview.19 | 32 | 3/26/2026 |
| 0.1.1-preview.18 | 36 | 3/26/2026 |
| 0.1.1-preview.17 | 38 | 3/25/2026 |
| 0.1.1-preview.16 | 36 | 3/25/2026 |
| 0.1.1-preview.15 | 30 | 3/25/2026 |