Quilt4Net.Toolkit 0.7.9

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

Quilt4Net.Toolkit

GitHub repo

Core library providing health checks, metrics, remote configuration, feature toggles, content management, and Application Insights integration for .NET applications.

Features can be configured and monitored using Quilt4Net Web.

Feature toggles and remote configuration

Manage configuration and feature flags remotely via Quilt4Net Web or with a Blazor component from Quilt4Net.Toolkit.Blazor.

Feature toggles are boolean values of remote configuration.

Get started

Install the NuGet package Quilt4Net.Toolkit and register the service.

builder.AddQuilt4NetRemoteConfiguration();

Add your API key from Quilt4Net Web in appsettings.json.

{
  "Quilt4Net": {
    "ApiKey": "YOUR_API_KEY_HERE"
  }
}

Feature toggles

Inject IFeatureToggleService to check boolean feature flags.

public class MyService
{
    private readonly IFeatureToggleService _featureToggle;

    public MyService(IFeatureToggleService featureToggle)
    {
        _featureToggle = featureToggle;
    }

    public async Task DoWorkAsync()
    {
        if (await _featureToggle.GetToggleAsync("new-feature", fallback: false))
        {
            // new feature logic
        }
    }
}

Remote configuration

Inject IRemoteConfigurationService for typed configuration values.

var maxRetries = await _configService.GetValueAsync("MaxRetries", fallback: 3);

RemoteConfigurationOptions

Property Default Description
ApiKey null API key from Quilt4Net Web.
Quilt4NetAddress "https://quilt4net.com/" Quilt4Net server address.
Ttl null Time-to-live for cached values.

Configuration path: Quilt4Net:RemoteConfiguration

Content management

Manage multilingual content from Quilt4Net Web.

builder.AddQuilt4NetContent();

Inject IContentService to retrieve and manage content.

var (value, success) = await _contentService.GetContentAsync("welcome-message", "Hello!", languageKey, ContentFormat.String);

ContentOptions

Property Default Description
Application Assembly name Application name.
Quilt4NetAddress "https://quilt4net.com/" Quilt4Net server address.
ApiKey null API key from Quilt4Net Web.

Configuration path: Quilt4Net:Content

Health check client

Client for consuming health endpoints from a remote service that uses Quilt4Net Health API.

builder.AddQuilt4NetHealthClient(o =>
{
    o.HealthAddress = "https://my-service.example.com/api/Health/";
});

Inject IHealthClient to call remote health endpoints.

var health = await _healthClient.GetHealthAsync(cancellationToken);
var metrics = await _healthClient.GetMetricsAsync(cancellationToken);
var version = await _healthClient.GetVersionAsync(cancellationToken);

HealthClientOptions

Property Default Description
HealthAddress null Address to the remote health API.

Configuration path: Quilt4Net:HealthClient

Application Insights client

Client for querying Application Insights data (logs, metrics, exceptions).

builder.AddQuilt4NetApplicationInsightsClient();

ApplicationInsightsOptions

Property Default Description
TenantId null Azure AD tenant ID (found under "Tenant properties" in Azure portal). Only required when AuthMode = ClientSecret.
WorkspaceId null Application Insights workspace ID.
ClientId null For ClientSecret: app registration client ID with Data.Read permission on Application Insights API. For ManagedIdentity: empty for system-assigned MI, or the user-assigned MI's client ID. For DefaultAzureCredential: optional hint, used as the preferred user-assigned MI when MI lights up in the chain.
ClientSecret null Client secret for the app registration. Only required when AuthMode = ClientSecret.
AuthMode ClientSecret Authentication mode: ClientSecret (service principal), ManagedIdentity (Azure-hosted apps), or DefaultAzureCredential (chained — same config works locally via az login and in Azure via MI).
EnvironmentOrder ["Development", "CI", "Staging", "Test", "Production"] Preferred environment ordering for the version matrix. Names not listed render after, alphabetically; rows with empty env render last as (unknown).
ApplicationAlias [] Static raw → logical alias map for VersionMatrixDisplay consumers that don't pass a per-component AliasFolder delegate. Each entry groups one or more raw cloud_RoleName values under a single logical application name.

Configuration path: Quilt4Net:ApplicationInsights

Managed Identity

When the app runs in Azure (App Service, Container Apps, VMs, …) you can skip the client secret entirely and authenticate with the hosting identity:

{
  "Quilt4Net": {
    "ApplicationInsights": {
      "WorkspaceId": "your-workspace-id",
      "AuthMode": "ManagedIdentity"
    }
  }
}

Grant the App Service identity the Log Analytics Reader (or Monitoring Reader) role on the target workspace. Use a user-assigned MI by setting ClientId to the identity's client ID; leave it empty for system-assigned.

DefaultAzureCredential

Use DefaultAzureCredential to share a single configuration across local dev and Azure-hosted environments:

{
  "Quilt4Net": {
    "ApplicationInsights": {
      "WorkspaceId": "your-workspace-id",
      "AuthMode": "DefaultAzureCredential"
    }
  }
}

The chained credential probes (in order): environment variables → workload identity → Managed Identity → Visual Studio / VS Code account → Azure CLI (az login) → Azure PowerShell. The first that succeeds is used.

Typical setup:

  • Local development: developer runs az login once. The toolkit picks up that token and queries the workspace directly — no service principal secret to copy into user-secrets.
  • Azure: the App Service identity is used (same effect as ManagedIdentity). Grant it Log Analytics Reader as above.

TenantId and ClientId are forwarded as hints (filter to a specific tenant; prefer a specific user-assigned MI) — both can be left empty.

Trade-off: DefaultAzureCredential masks which underlying credential succeeded. If authentication fails, the error chain is less specific than the explicit modes. For diagnosis, switch to ClientSecret or ManagedIdentity to isolate the issue.

Universal telemetry identity

AddQuilt4NetLogging() configures OpenTelemetry resource attributes and registers two BaseProcessors — one for LogRecord, one for Activity — that copy a fixed set of identity attributes onto every per-record Properties bag. Works for all app types; the Azure Monitor exporter forwards the per-record attributes into customDimensions, where KQL can read them.

var builder = WebApplication.CreateBuilder(args);

builder.AddQuilt4NetLogging();

Five attributes attached to every AppTrace, AppException, AppRequest (and outbound AppDependency):

Attribute key Default value Notes
service.name IHostEnvironment.ApplicationName → entry assembly name (framework assemblies excluded) Also surfaces as the cloud_RoleName column.
service.version Entry assembly version Also surfaces as application_Version.
host.name Environment.MachineName Also surfaces as cloud_RoleInstance.
deployment.environment IHostEnvironment.EnvironmentNameDOTNET_ENVIRONMENTASPNETCORE_ENVIRONMENT"Production" The Azure Monitor exporter does not forward arbitrary OTel resource attributes into per-row Properties, so the per-record processor copies it in too.
quilt4net.monitor "Quilt4Net" (configurable via MonitorName) Identifies which instrumentation produced the row. Useful when several Quilt4Net-hosted services ship to the same workspace.

Override via callback or appsettings.json:

builder.AddQuilt4NetLogging(o =>
{
    o.ApplicationName = "florida-server";
    o.Version = "2.0.0";
    o.Environment = "Production";
    o.MonitorName = "florida";
});
{
  "Quilt4Net": {
    "Logging": {
      "ApplicationName": "florida-server",
      "Version": "2.0.0",
      "Environment": "Production",
      "MonitorName": "florida"
    }
  }
}

AddQuilt4NetLogging() returns a Quilt4NetLoggingBuilder that extension packages can chain off. Quilt4Net.Toolkit.Api adds .AddHttpRequestLogging() to enable HTTP request/response middleware including the X-Correlation-ID propagation scope:

builder.AddQuilt4NetLogging()
    .AddHttpRequestLogging();

When Quilt4Net.Toolkit.Api's CorrelationIdMiddleware is active, every ILogger call inside a request also picks up customDimensions["CorrelationId"] automatically — see the Api package README.

Measure extensions

Extension methods on ILogger to measure and log execution time.

// Measure synchronous work
_logger.Measure("ProcessOrder", () =>
{
    // work to measure
});

// Measure async work with result
var result = await _logger.MeasureAsync("FetchData", async () =>
{
    return await _repository.GetDataAsync();
});

// Log a count
_logger.Count("ItemsProcessed", items.Length);

Logging attributes

Control HTTP request/response logging on endpoints.

[Logging(RequestBody = true, ResponseBody = false)]
public async Task<IActionResult> StreamData() { ... }

[LoggingStream] // Shorthand for ResponseBody = false
public async Task<IActionResult> StreamEvents() { ... }

Configuration

All options can be set via code or appsettings.json. Code takes priority.

{
  "Quilt4Net": {
    "ApiKey": "YOUR_API_KEY_HERE",
    "HealthClient": {
      "HealthAddress": "https://my-service.example.com/api/Health/"
    },
    "ApplicationInsights": {
      "TenantId": "your-tenant-id",
      "WorkspaceId": "your-workspace-id",
      "ClientId": "your-client-id",
      "ClientSecret": "your-client-secret",
      "AuthMode": "ClientSecret"
    },
    "RemoteConfiguration": {
      "Ttl": "00:10:00"
    },
    "Content": {
      "Application": "MyApp"
    }
  }
}
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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 (4)

Showing the top 4 NuGet packages that depend on Quilt4Net.Toolkit:

Package Downloads
Quilt4Net.Toolkit.Api

Support for API health, liveness, readiness, startup, metrics, version and dependencies.

Quilt4Net.Toolkit.Blazor

Package Description

Quilt4Net.Toolkit.Health

Features for health, liveness, readiness, startup, metrics, version and dependencies. Adds a health API.

Quilt4Net.Toolkit.Mcp

MCP (Model Context Protocol) provider for Quilt4Net.Toolkit. Exposes Application Insights query operations as MCP tools and resources, plugging into the Tharga.Mcp ecosystem so AI agents can look up incidents and correlate logs.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.7.9 25 5/10/2026
0.7.8 48 5/9/2026
0.7.7 41 5/9/2026
0.7.6 95 5/6/2026
0.7.5 90 5/6/2026
0.7.4 161 4/30/2026
0.7.3 167 4/22/2026
0.7.2 138 4/20/2026
0.7.1 140 4/20/2026
0.7.0 137 4/19/2026
0.6.18 139 4/19/2026
0.6.17 140 4/19/2026
0.6.16 163 4/18/2026
0.6.15 147 4/18/2026
0.6.14 142 4/17/2026
0.6.13 147 4/15/2026
0.6.12 170 4/9/2026
0.6.11 152 4/9/2026
0.6.10 149 4/7/2026
0.6.9 164 4/5/2026
Loading failed