BellaBaxter.AspNet.Configuration 0.1.1-preview.19

This is a prerelease version of BellaBaxter.AspNet.Configuration.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package BellaBaxter.AspNet.Configuration --version 0.1.1-preview.19
                    
NuGet\Install-Package BellaBaxter.AspNet.Configuration -Version 0.1.1-preview.19
                    
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.19" />
                    
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.19" />
                    
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.19
                    
#r "nuget: BellaBaxter.AspNet.Configuration, 0.1.1-preview.19"
                    
#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.19
                    
#: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.19&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=BellaBaxter.AspNet.Configuration&version=0.1.1-preview.19&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 (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.49 39 4/9/2026
0.1.1-preview.48 36 4/9/2026
0.1.1-preview.47 31 4/9/2026
0.1.1-preview.46 34 4/9/2026
0.1.1-preview.45 30 4/9/2026
0.1.1-preview.44 35 4/9/2026
0.1.1-preview.36 53 3/30/2026
0.1.1-preview.35 38 3/30/2026
0.1.1-preview.34 37 3/30/2026
0.1.1-preview.33 40 3/30/2026
0.1.1-preview.32 40 3/30/2026
0.1.1-preview.31 44 3/30/2026
0.1.1-preview.30 45 3/27/2026
0.1.1-preview.29 40 3/27/2026
0.1.1-preview.28 32 3/27/2026
0.1.1-preview.27 35 3/27/2026
0.1.1-preview.26 36 3/26/2026
0.1.1-preview.23 41 3/26/2026
0.1.1-preview.22 40 3/26/2026
0.1.1-preview.19 34 3/26/2026
Loading failed