ConfigFerret.Octopus 0.2.0

dotnet add package ConfigFerret.Octopus --version 0.2.0
                    
NuGet\Install-Package ConfigFerret.Octopus -Version 0.2.0
                    
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="ConfigFerret.Octopus" Version="0.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ConfigFerret.Octopus" Version="0.2.0" />
                    
Directory.Packages.props
<PackageReference Include="ConfigFerret.Octopus" />
                    
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 ConfigFerret.Octopus --version 0.2.0
                    
#r "nuget: ConfigFerret.Octopus, 0.2.0"
                    
#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 ConfigFerret.Octopus@0.2.0
                    
#: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=ConfigFerret.Octopus&version=0.2.0
                    
Install as a Cake Addin
#tool nuget:?package=ConfigFerret.Octopus&version=0.2.0
                    
Install as a Cake Tool

ConfigFerret.Octopus

Adds Octopus Deploy variables to ConfigFerret traces, so a value in appsettings.json, an environment variable, a Kubernetes env entry or a ConfigMap key is traced back to the Octopus project or library variable set variable that set it, with the scope that made it apply.

dotnet add package ConfigFerret.Octopus
using ConfigFerret;
using ConfigFerret.Octopus;

var octopus = await OctopusVariables.LoadAsync(new OctopusVariablesOptions
{
    ServerUri = new Uri("https://contoso.octopus.app/"),
    ApiKey = Environment.GetEnvironmentVariable("OCTOPUS_API_KEY")!,  // never hard-code it
    Project = "billing-api",                                        // name, slug or Projects-N
    Space = "Default",                                              // optional, name or Spaces-N
});

var report = ConfigTracer.For(builder.Configuration)
    .WithOctopus(octopus, o =>
    {
        o.Environment = "Production";
        o.Roles.Add("web");
    })
    .Trace();

Console.WriteLine(report.Explain("Db:Timeout"));
// set in appsettings.json from Octopus variable Db:Timeout

Configure from appsettings and dependency injection

Put everything except the API key in configuration, and register the source:

// appsettings.json: no API key here
{
  "ConfigFerret": {
    "Octopus": {
      "ServerUri": "https://contoso.octopus.app/",
      "Space": "Default",
      "Project": "billing-api",
      "Environment": "Production",
      "Roles": [ "web" ],
      "Links": { "DB__TIMEOUT": "Db:Timeout" }
    }
  }
}
builder.Services.AddConfigFerretOctopus(builder.Configuration.GetSection("ConfigFerret:Octopus"));
var app = builder.Build();

var tracer = ConfigTracer.For(builder.Configuration);
await tracer.WithOctopusAsync(app.Services);
Console.WriteLine(tracer.Trace().Explain("Db:Timeout"));

Supply the API key from somewhere that is not committed:

dotnet user-secrets set "ConfigFerret:Octopus:ApiKey" "API-..."    # development
export ConfigFerret__Octopus__ApiKey="API-..."                     # CI, containers

or from a key vault configuration provider.

Every property of OctopusVariablesOptions and OctopusTraceOptions binds from the section (Machine, Channel, Step, TenantTags, IncludeLibraryVariableSets, MatchConfigurationKeys, MatchByName and so on).

When the host starts, the options are checked, and startup fails with a message naming the key when:

  • ServerUri, Project or ApiKey is missing,
  • ServerUri is not HTTPS (plain HTTP only to localhost or with AllowUnencryptedHttp) or holds credentials,
  • the API key is in any appsettings*.json file, even one that another source overrides, since that file is usually committed. User secrets (secrets.json), environment variables and key vaults are fine.

The messages never include the API key. Without a host, the same checks run the first time the options are read.

How layers are linked

  • JSON keys (on by default, MatchConfigurationKeys): a key in a JSON file is linked to the Octopus variable with the same name, for example Db:Timeout, the way Octopus structured configuration variables replace it.
  • Same name (on by default, MatchByName): an environment variable, env entry or ConfigMap/Secret key with the same name as an Octopus variable.
  • Explicit links (Map("DB__TIMEOUT", "Db:Timeout")).

Only variables whose scope fits the deployment are listed: set Environment, Machine, Roles, Channel, Step and TenantTags to describe it. A variable scoped on something you did not set is kept but marked as inferred, with a note naming the scope. Variables are ordered by how specific their scope is (step, then target, then target tag, then environment), and a project variable wins over a library variable set one of equal scope, so the last one is the value Octopus uses. Where tenant tags and channels fall in that order is a best guess, and two equally scoped values produce a warning.

API keys and sensitive values

  • The API key needs permission to view the project and its variables (VariableView). A key for a service account with read-only access is best.
  • The key is sent only in the X-Octopus-ApiKey header, only over HTTPS (plain HTTP only to localhost or with AllowUnencryptedHttp), and redirects are not followed. It never appears in a report or an exception message.
  • Octopus never returns sensitive values, so sensitive variables show up by name only and are marked sensitive. The usual ConfigFerret redaction then hides the value of every layer in that chain, and values of keys that look secret are hidden even when Octopus does not mark them sensitive.
  • Values that reference other variables (#{Name}) are shown as written, not expanded.
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.  net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.0 108 11/13/2026