Azure.Deployments.Extensibility.AspNetCore 0.1.147

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

Azure.Deployments.Extensibility.AspNetCore

ASP.NET Core hosting framework for building Bicep extensions. Provides a fluent API for handler registration, middleware pipeline, request routing, and behavior (decorator) chains on top of the Core SDK.

Quick start

using Azure.Deployments.Extensibility.AspNetCore;

ExtensionApplication.Create(args)
    .AddExtensionVersion("1.*.*", version => version
        .ForResourceType("Fortune", type => type
            .AddHandler<FortunePreviewHandler>()
            .AddHandler<FortuneCreateOrUpdateHandler>()
            .AddHandler<FortuneGetHandler>()
            .AddHandler<FortuneDeleteHandler>()))
    .Run();

ExtensionApplication handles JSON serialization, error handling, correlation headers, culture propagation, and endpoint routing automatically.

Key concepts

Handler registration

Register handlers by extension version range and optional resource type. The framework auto-detects which handler interfaces each class implements (IResourcePreviewHandler, IResourceCreateOrUpdateHandler, IResourceGetHandler, IResourceDeleteHandler, ILongRunningOperationGetHandler).

app.AddExtensionVersion(">=1.0.0 <2.0.0", version => version
    .AddHandler<FallbackHandler>()                    // default handler for this version range
    .ForResourceType("Employee", type => type         // resource-type-specific handlers
        .AddHandler<EmployeePreviewHandler>()
        .AddHandler<EmployeeCreateOrUpdateHandler>()));

Typed handler base classes

Extend one of the typed base classes to work with strongly-typed models instead of raw JsonObject:

Base class Operation
TypedResourcePreviewHandler<TProperties, TIdentifiers> Preview
TypedResourceCreateOrUpdateHandler<TProperties, TIdentifiers> Create or update
TypedResourceGetHandler<TProperties, TIdentifiers> Get
TypedResourceDeleteHandler<TProperties, TIdentifiers> Delete

Each base class automatically deserializes the request and serializes the response using the ASP.NET Core JsonOptions.

Behaviors (decorators)

Behaviors wrap handler invocations for cross-cutting concerns such as validation, logging, or authorization. They execute in order: global → version-scoped → resource-type-scoped.

// Global — runs on every handler invocation.
app.AddGlobalHandlerBehavior<LoggingBehavior>();

app.AddExtensionVersion("1.*.*", version => version
    // Version-scoped — runs on all handlers in this version range.
    .AddHandlerBehavior<ApiVersionValidationBehavior>()
    .ForResourceType("Fortune", type => type
        // Resource-type-scoped — runs only on Fortune handlers.
        .AddHandlerBehavior<FortuneAuthorizationBehavior>()
        .AddHandler<FortuneCreateOrUpdateHandler>()));

Implement IResourcePreviewBehavior, IResourceCreateOrUpdateBehavior, IResourceGetBehavior, IResourceDeleteBehavior, or ILongRunningOperationGetBehavior as needed. A single class can implement multiple behavior interfaces.

Scalar API explorer

Enable a development-time API explorer powered by Scalar with request/response examples:

app.EnableDevelopmentScalarApiExplorer(explorer => explorer
    .WithTitle("My Extension API")
    .WithExtensionVersions("1.0.0", "2.0.0")
    .ConfigureExamples(examples => examples
        .ForPreview(requestExample, responseExample)
        .ForCreateOrUpdate(requestExample, responseExample)));

Request headers

Read extensibility request headers using HttpContextExtensions:

var clientRequestId = httpContext.GetClientRequestId();
var correlationId = httpContext.GetCorrelationRequestId();
var tenantId = httpContext.GetClientTenantId();

Documentation

License

This project is licensed under the MIT License.

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 was computed.  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 was computed.  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 Azure.Deployments.Extensibility.AspNetCore:

Package Downloads
Azure.Deployments.Extensibility.Extensions.Kubernetes

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.147 112 4/17/2026
0.1.135 121 3/23/2026
0.1.115 243 12/22/2025
0.1.113 177 12/12/2025
0.1.102 224 10/23/2025
0.1.67 260 1/31/2025
0.1.55 261 6/24/2024