BellaBaxter.AspNet.Configuration 0.1.1-preview.36

This is a prerelease version of BellaBaxter.AspNet.Configuration.
dotnet add package BellaBaxter.AspNet.Configuration --version 0.1.1-preview.36
                    
NuGet\Install-Package BellaBaxter.AspNet.Configuration -Version 0.1.1-preview.36
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="BellaBaxter.AspNet.Configuration" Version="0.1.1-preview.36" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BellaBaxter.AspNet.Configuration" Version="0.1.1-preview.36" />
                    
Directory.Packages.props
<PackageReference Include="BellaBaxter.AspNet.Configuration" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add BellaBaxter.AspNet.Configuration --version 0.1.1-preview.36
                    
#r "nuget: BellaBaxter.AspNet.Configuration, 0.1.1-preview.36"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package BellaBaxter.AspNet.Configuration@0.1.1-preview.36
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=BellaBaxter.AspNet.Configuration&version=0.1.1-preview.36&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=BellaBaxter.AspNet.Configuration&version=0.1.1-preview.36&prerelease
                    
Install as a Cake Tool

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

  1. On startup: GET /api/v1/environments/{slug}/secrets → loads all secrets into IConfiguration
  2. Every PollingInterval: GET /api/v1/environments/{slug}/secrets/version (lightweight version check)
  3. If version changed: fetches full secrets → calls OnReload() → triggers IOptionsMonitor<T>.OnChange()
  4. 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
Loading failed