Aspire.Hosting.SqlServer (13.5.2)

Published 2026-09-09 02:36:30 +03:30 by kayer

Installation

dotnet nuget add source --name kayer --username your_username --password your_token 
dotnet add package --source kayer --version 13.5.2 Aspire.Hosting.SqlServer

About this package

Microsoft SQL Server support for Aspire.

SQL Server hosting integration

Use this integration to model, configure, and orchestrate a SQL Server database resource in an Aspire solution.

Getting started

Add the integration

From your AppHost directory, add the Aspire.Hosting.SqlServer integration with the Aspire CLI:

aspire add Aspire.Hosting.SqlServer

Usage example

In the AppHost, add a SQL Server resource and reference it from another resource with either C# or TypeScript:

C#

var db = builder.AddSqlServer("sql").AddDatabase("db");

var myService = builder.AddProject<Projects.MyService>()
   .WithReference(db);

TypeScript

const db = await builder.addSqlServer("sql").addDatabase("db");

const myService = await builder.addNodeApp("myService", "../my-service", "server.js")
   .withReference(db);

Connection Properties

When you reference a SQL Server resource using WithReference, the following connection properties are made available to the consuming project:

SQL Server server

The SQL Server server resource exposes the following connection properties:

Property Name Description
Host The hostname or IP address of the SQL Server
Port The port number the SQL Server is listening on
Username The username for authentication
Password The password for authentication
Uri The connection URI in mssql:// format, with the format mssql://{Username}:{Password}@{Host}:{Port}
JdbcConnectionString JDBC-format connection string, with the format jdbc:sqlserver://{Host}:{Port};trustServerCertificate=true. User and password credentials are provided as separate Username and Password properties.

SQL Server database

The SQL Server database resource inherits all properties from its parent SqlServerServerResource and adds:

Property Name Description
Uri The connection URI in mssql:// format, with the format mssql://{Username}:{Password}@{Host}:{Port}/{DatabaseName}
JdbcConnectionString JDBC connection string with database name, with the format jdbc:sqlserver://{Host}:{Port};trustServerCertificate=true;databaseName={DatabaseName}. User and password credentials are provided as separate Username and Password properties.
DatabaseName The name of the database

Aspire exposes each property as an environment variable named [RESOURCE]_[PROPERTY]. For instance, the Uri property of a resource called db1 becomes DB1_URI.

Additional documentation

https://aspire.dev/integrations/gallery/ https://aspire.dev/integrations/databases/sql-server/sql-server-host/

Feedback & contributing

https://github.com/microsoft/aspire

Dependencies

ID Version Target Framework
Aspire.Hosting 13.5.2 net10.0
AspNetCore.HealthChecks.SqlServer 9.0.0 net10.0
AspNetCore.HealthChecks.Uris 9.0.0 net10.0
Google.Protobuf 3.34.1 net10.0
Grpc.AspNetCore 2.80.0 net10.0
Grpc.Net.ClientFactory 2.80.0 net10.0
Grpc.Tools 2.80.0 net10.0
Humanizer.Core 3.0.10 net10.0
JsonPatch.Net 5.0.2 net10.0
KubernetesClient 19.0.2 net10.0
Microsoft.Data.SqlClient 7.0.1 net10.0
Microsoft.Extensions.Caching.Memory 10.0.11 net10.0
Microsoft.Extensions.Configuration.Abstractions 10.0.11 net10.0
Microsoft.Extensions.Configuration.Binder 10.0.11 net10.0
Microsoft.Extensions.Configuration.EnvironmentVariables 10.0.11 net10.0
Microsoft.Extensions.DependencyInjection.Abstractions 10.0.11 net10.0
Microsoft.Extensions.Diagnostics.HealthChecks 10.0.11 net10.0
Microsoft.Extensions.FileSystemGlobbing 10.0.11 net10.0
Microsoft.Extensions.Hosting 10.0.11 net10.0
Microsoft.Extensions.Hosting.Abstractions 10.0.11 net10.0
Microsoft.Extensions.Http 10.0.11 net10.0
Microsoft.Extensions.Logging 10.0.11 net10.0
Microsoft.Extensions.Logging.Abstractions 10.0.11 net10.0
Microsoft.Extensions.Options 10.0.11 net10.0
Microsoft.Extensions.Primitives 10.0.11 net10.0
ModelContextProtocol 1.3.0 net10.0
Newtonsoft.Json 13.0.4 net10.0
OpenTelemetry.Exporter.OpenTelemetryProtocol 1.15.3 net10.0
OpenTelemetry.Extensions.Hosting 1.15.3 net10.0
Polly.Core 8.6.6 net10.0
Semver 3.0.0 net10.0
StreamJsonRpc 2.25.29 net10.0
System.IO.Hashing 10.0.8 net10.0
System.Security.Cryptography.Pkcs 10.0.11 net10.0
YamlDotNet 16.3.0 net10.0
Aspire.Hosting 13.5.2 net8.0
AspNetCore.HealthChecks.SqlServer 9.0.0 net8.0
AspNetCore.HealthChecks.Uris 9.0.0 net8.0
Google.Protobuf 3.34.1 net8.0
Grpc.AspNetCore 2.80.0 net8.0
Grpc.Net.ClientFactory 2.80.0 net8.0
Grpc.Tools 2.80.0 net8.0
Humanizer.Core 3.0.10 net8.0
JsonPatch.Net 5.0.2 net8.0
KubernetesClient 19.0.2 net8.0
Microsoft.Data.SqlClient 7.0.1 net8.0
Microsoft.Extensions.Caching.Memory 10.0.11 net8.0
Microsoft.Extensions.Configuration.Abstractions 10.0.11 net8.0
Microsoft.Extensions.Configuration.Binder 10.0.11 net8.0
Microsoft.Extensions.Configuration.EnvironmentVariables 10.0.11 net8.0
Microsoft.Extensions.DependencyInjection.Abstractions 10.0.11 net8.0
Microsoft.Extensions.Diagnostics.HealthChecks 8.0.30 net8.0
Microsoft.Extensions.FileSystemGlobbing 10.0.11 net8.0
Microsoft.Extensions.Hosting 10.0.11 net8.0
Microsoft.Extensions.Hosting.Abstractions 10.0.11 net8.0
Microsoft.Extensions.Http 10.0.11 net8.0
Microsoft.Extensions.Logging 10.0.11 net8.0
Microsoft.Extensions.Logging.Abstractions 10.0.11 net8.0
Microsoft.Extensions.Options 10.0.11 net8.0
Microsoft.Extensions.Primitives 10.0.11 net8.0
ModelContextProtocol 1.3.0 net8.0
Newtonsoft.Json 13.0.4 net8.0
OpenTelemetry.Exporter.OpenTelemetryProtocol 1.15.3 net8.0
OpenTelemetry.Extensions.Hosting 1.15.3 net8.0
Polly.Core 8.6.6 net8.0
Semver 3.0.0 net8.0
StreamJsonRpc 2.25.29 net8.0
System.Formats.Asn1 10.0.11 net8.0
System.IO.Hashing 10.0.8 net8.0
System.Security.Cryptography.Pkcs 10.0.11 net8.0
System.Text.Json 10.0.11 net8.0
YamlDotNet 16.3.0 net8.0
Aspire.Hosting 13.5.2 net9.0
AspNetCore.HealthChecks.SqlServer 9.0.0 net9.0
AspNetCore.HealthChecks.Uris 9.0.0 net9.0
Google.Protobuf 3.34.1 net9.0
Grpc.AspNetCore 2.80.0 net9.0
Grpc.Net.ClientFactory 2.80.0 net9.0
Grpc.Tools 2.80.0 net9.0
Humanizer.Core 3.0.10 net9.0
JsonPatch.Net 5.0.2 net9.0
KubernetesClient 19.0.2 net9.0
Microsoft.Data.SqlClient 7.0.1 net9.0
Microsoft.Extensions.Caching.Memory 10.0.11 net9.0
Microsoft.Extensions.Configuration.Abstractions 10.0.11 net9.0
Microsoft.Extensions.Configuration.Binder 10.0.11 net9.0
Microsoft.Extensions.Configuration.EnvironmentVariables 10.0.11 net9.0
Microsoft.Extensions.DependencyInjection.Abstractions 10.0.11 net9.0
Microsoft.Extensions.Diagnostics.HealthChecks 9.0.19 net9.0
Microsoft.Extensions.FileSystemGlobbing 10.0.11 net9.0
Microsoft.Extensions.Hosting 10.0.11 net9.0
Microsoft.Extensions.Hosting.Abstractions 10.0.11 net9.0
Microsoft.Extensions.Http 10.0.11 net9.0
Microsoft.Extensions.Logging 10.0.11 net9.0
Microsoft.Extensions.Logging.Abstractions 10.0.11 net9.0
Microsoft.Extensions.Options 10.0.11 net9.0
Microsoft.Extensions.Primitives 10.0.11 net9.0
ModelContextProtocol 1.3.0 net9.0
Newtonsoft.Json 13.0.4 net9.0
OpenTelemetry.Exporter.OpenTelemetryProtocol 1.15.3 net9.0
OpenTelemetry.Extensions.Hosting 1.15.3 net9.0
Polly.Core 8.6.6 net9.0
Semver 3.0.0 net9.0
StreamJsonRpc 2.25.29 net9.0
System.Formats.Asn1 10.0.11 net9.0
System.IO.Hashing 10.0.8 net9.0
System.Security.Cryptography.Pkcs 10.0.11 net9.0
System.Text.Json 10.0.11 net9.0
YamlDotNet 16.3.0 net9.0
Details
NuGet
2026-09-09 02:36:30 +03:30
1
Microsoft
203 KiB
Assets (2)
Versions (1) View all
13.5.2 2026-09-09