CommunityToolkit.Aspire.Hosting.Azure.DataApiBuilder 13.1.1

Prefix Reserved
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package CommunityToolkit.Aspire.Hosting.Azure.DataApiBuilder --version 13.1.1
                    
NuGet\Install-Package CommunityToolkit.Aspire.Hosting.Azure.DataApiBuilder -Version 13.1.1
                    
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="CommunityToolkit.Aspire.Hosting.Azure.DataApiBuilder" Version="13.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CommunityToolkit.Aspire.Hosting.Azure.DataApiBuilder" Version="13.1.1" />
                    
Directory.Packages.props
<PackageReference Include="CommunityToolkit.Aspire.Hosting.Azure.DataApiBuilder" />
                    
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 CommunityToolkit.Aspire.Hosting.Azure.DataApiBuilder --version 13.1.1
                    
#r "nuget: CommunityToolkit.Aspire.Hosting.Azure.DataApiBuilder, 13.1.1"
                    
#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 CommunityToolkit.Aspire.Hosting.Azure.DataApiBuilder@13.1.1
                    
#: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=CommunityToolkit.Aspire.Hosting.Azure.DataApiBuilder&version=13.1.1
                    
Install as a Cake Addin
#tool nuget:?package=CommunityToolkit.Aspire.Hosting.Azure.DataApiBuilder&version=13.1.1
                    
Install as a Cake Tool

CommunityToolkit.Hosting.Azure.DataApiBuilder

Overview

This .NET Aspire Integration runs Data API builder in a container. Data API builder generates secure, feature-rich REST and GraphQL endpoints for Tables, Views and Stored Procedures performing CRUD (Create, Read, Update, Delete, Execute) operations against Azure SQL Database, SQL Server, PostgreSQL, MySQL and Azure CosmosDB.

Usage

Example 1: Single data source

var builder = DistributedApplication.CreateBuilder(args);

var sqlDatabase = builder
    .AddSqlServer("your-server-name")
    .AddDatabase("your-database-name");

var dab = builder.AddDataAPIBuilder("dab")
    .WithReference(sqlDatabase)
    .WaitFor(sqlDatabase);

var app = builder
    .AddProject<Projects.Client>()
    .WithReference(dab);

builder.Build().Run();

Example 2: Multiple data sources

var builder = DistributedApplication.CreateBuilder(args);

var sqlDatabase1 = builder
    .AddSqlServer("your-server-name")
    .AddDatabase("your-database-name");

var sqlDatabase2 = builder
    .AddSqlServer("your-server-name")
    .AddDatabase("your-database-name");

var dab = builder.AddDataAPIBuilder("dab", 
        "./dab-config-1.json", 
        "./dab-config-2.json")
    .WithReference(sqlDatabase1)
    .WithReference(sqlDatabase2)
    .WaitFor(sqlDatabase1)
    .WaitFor(sqlDatabase2);

var app = builder
    .AddProject<Projects.Client>()
    .WithReference(dab);

builder.Build().Run();

Note: All files are mounted/copied to the same /App folder.

Example 3: Cosmos DB and a schema file

var builder = DistributedApplication.CreateBuilder(args);

var cosmosdb = builder
    .AddAzureCosmosDB("myNewCosmosAccountName")
    .AddDatabase("myCosmosDatabaseName");

var dab = builder.AddDataAPIBuilder("dab",
        "./dab-config.json",
        "./schema.graphql")
    .WithReference(cosmosdb)
    .WaitFor(cosmosdb);

var app = builder
    .AddProject<Projects.Client>()
    .WithReference(dab);

builder.Build().Run();

Example 4: Connection string-only

var builder = DistributedApplication.CreateBuilder(args);

var sqlDatabase = builder
    .AddConnectionString("your-cs-name");

var dab = builder.AddDataAPIBuilder("dab")
    .WithReference(sqlDatabase);

var app = builder
    .AddProject<Projects.Client>()
    .WithReference(dab);

builder.Build().Run();

Configuration

  • name - The name of the resource.
  • port - The optional port number for the Data API builder container. Defaults to random.
  • configFilePaths - Opiotnal paths to the config/schema file(s) for Data API builder. Default is ./dab-config.json.

Data API builder Container Image Configuration

You can specify custom registry/image/tag values by using the WithImageRegistry/WithImage/WithImageTag methods:

var dab = builder.AddDataAPIBuilder("dab")
    .WithImageRegistry("mcr.microsoft.com")
    .WithImage("azure-databases/data-api-builder")
    .WithImageTag("latest");

OpenTelemetry Instrumentation

The Data API builder integration automatically configures OpenTelemetry (OTEL) instrumentation for distributed tracing and metrics. The integration uses the standard .WithOtlpExporter() method which sets up the necessary OTEL environment variables that Data API builder automatically recognizes.

To enable OTEL telemetry in Data API builder, add the following configuration to your dab-config.json file:

{
  "runtime": {
    "telemetry": {
      "open-telemetry": {
        "enabled": true,
        "service-name": "@env('OTEL_SERVICE_NAME')",
        "endpoint": "@env('OTEL_EXPORTER_OTLP_ENDPOINT')",
        "exporter-protocol": "grpc",
        "headers": "@env('OTEL_EXPORTER_OTLP_HEADERS')"
      }
    }
  }
}

The configuration includes the following settings:

  • enabled: Enables/disables OTEL telemetry (default: false)
  • service-name: Logical name for the service in traces. Uses the @env('OTEL_SERVICE_NAME') syntax to reference the environment variable automatically set by Aspire
  • endpoint: OTEL collector endpoint URL. Uses @env('OTEL_EXPORTER_OTLP_ENDPOINT') to reference the Aspire-provided endpoint
  • exporter-protocol: Protocol for exporting telemetry. Set to grpc for efficient binary transport
  • headers: Custom headers for OTEL export. Uses @env('OTEL_EXPORTER_OTLP_HEADERS') to reference Aspire-provided headers

With this configuration, Data API builder will:

  • Export traces and metrics to the Aspire dashboard via OTLP (OpenTelemetry Protocol)
  • Automatically use the OTEL endpoint provided by the Aspire app host
  • Include telemetry for REST and GraphQL operations, database queries, and system metrics

For more information about Data API builder telemetry, see the official documentation.

Known Issues

The current imlpementation of the Data API builder .NET Aspire integration does not support HTTPS endpoints. However, this is only a dev-time consideration. Service discovery when published can use HTTPS without any problems.

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

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
13.2.1-beta.532 78 3/13/2026
13.2.1-beta.531 56 3/11/2026
13.2.1-beta.528 55 3/5/2026
13.1.2-beta.518 67 2/17/2026
13.1.2-beta.516 63 2/9/2026
13.1.2-beta.515 63 2/2/2026
13.1.2-beta.514 59 1/30/2026
13.1.2-beta.513 60 1/29/2026
13.1.2-beta.512 61 1/29/2026
13.1.2-beta.511 58 1/28/2026
13.1.2-beta.509 63 1/20/2026
13.1.2-beta.508 62 1/19/2026
13.1.2-beta.507 61 1/19/2026
13.1.2-beta.506 65 1/16/2026
13.1.2-beta.505 59 1/16/2026
13.1.2-beta.504 62 1/16/2026
13.1.1 1,220 1/16/2026
13.1.1-beta.502 60 1/16/2026
13.1.0 209 1/14/2026
13.1.0-beta.499 62 1/14/2026
Loading failed