BellaBaxter.AspNet.Configuration
0.1.1-preview.83
See the version list below for details.
dotnet add package BellaBaxter.AspNet.Configuration --version 0.1.1-preview.83
NuGet\Install-Package BellaBaxter.AspNet.Configuration -Version 0.1.1-preview.83
<PackageReference Include="BellaBaxter.AspNet.Configuration" Version="0.1.1-preview.83" />
<PackageVersion Include="BellaBaxter.AspNet.Configuration" Version="0.1.1-preview.83" />
<PackageReference Include="BellaBaxter.AspNet.Configuration" />
paket add BellaBaxter.AspNet.Configuration --version 0.1.1-preview.83
#r "nuget: BellaBaxter.AspNet.Configuration, 0.1.1-preview.83"
#:package BellaBaxter.AspNet.Configuration@0.1.1-preview.83
#addin nuget:?package=BellaBaxter.AspNet.Configuration&version=0.1.1-preview.83&prerelease
#tool nuget:?package=BellaBaxter.AspNet.Configuration&version=0.1.1-preview.83&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.83)
- Microsoft.Extensions.Configuration (>= 10.0.7)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.7)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.7)
- Microsoft.Extensions.Http (>= 10.0.7)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.7)
- Microsoft.Extensions.Options (>= 10.0.7)
NuGet packages (2)
Showing the top 2 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. |
|
|
BellaBaxter.Maui
.NET MAUI secure secret cache for Bella Baxter. Uses SecureStorage (iOS Keychain, Android EncryptedSharedPreferences, Windows DPAPI) to cache secrets offline. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.1-preview.95 | 68 | 6/16/2026 |
| 0.1.1-preview.94 | 77 | 6/16/2026 |
| 0.1.1-preview.92 | 64 | 6/10/2026 |
| 0.1.1-preview.91 | 80 | 5/27/2026 |
| 0.1.1-preview.90 | 73 | 5/22/2026 |
| 0.1.1-preview.89 | 64 | 5/22/2026 |
| 0.1.1-preview.88 | 56 | 5/14/2026 |
| 0.1.1-preview.87 | 65 | 5/14/2026 |
| 0.1.1-preview.86 | 58 | 5/14/2026 |
| 0.1.1-preview.85 | 54 | 5/14/2026 |
| 0.1.1-preview.84 | 55 | 5/14/2026 |
| 0.1.1-preview.83 | 62 | 5/11/2026 |
| 0.1.1-preview.82 | 56 | 5/5/2026 |
| 0.1.1-preview.81 | 68 | 4/29/2026 |
| 0.1.1-preview.80 | 67 | 4/28/2026 |
| 0.1.1-preview.79 | 54 | 4/28/2026 |
| 0.1.1-preview.78 | 54 | 4/28/2026 |
| 0.1.1-preview.77 | 57 | 4/27/2026 |
| 0.1.1-preview.76 | 57 | 4/27/2026 |
| 0.1.1-preview.75 | 61 | 4/27/2026 |