Aspire.Hosting.SqlServer 13.5.3

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

No packages depend on Aspire.Hosting.SqlServer.

.NET 10.0

.NET 8.0

.NET 9.0

Version Downloads Last updated
13.5.3 9 2026-08-28
13.5.2 0 2026-08-21
13.5.1 0 2026-08-20
13.5.0 0 2026-08-18
13.4.6 0 2026-06-19
13.4.5 0 2026-06-17
13.4.4 0 2026-06-15
13.4.3 0 2026-06-08
13.4.2 0 2026-06-03
13.4.1 0 2026-06-03
13.4.0 0 2026-06-01
13.3.5 0 2026-05-21
13.3.4 0 2026-05-19
13.3.3 0 2026-05-15
13.3.2 0 2026-05-14
13.3.1 0 2026-05-12
13.3.0 0 2026-05-07
13.2.4 0 2026-04-24
13.2.3 0 2026-04-21
13.2.2 0 2026-04-08
13.2.1 0 2026-03-31
13.2.0 0 2026-03-23
13.1.3 0 2026-03-19
13.1.2 0 2026-02-26
13.1.1 0 2026-02-11
13.1.0 0 2025-12-17
13.0.2 0 2025-12-04
13.0.1 0 2025-11-26
13.0.0 0 2025-11-11
9.5.2 0 2025-10-23
9.5.1 0 2025-10-03
9.5.0 1 957 2025-10-08
9.4.2 0 2025-09-02
9.4.1 2 2025-09-05
9.4.0 2 2025-08-12
9.3.2 0 2025-06-20
9.3.1 0 2025-06-10
9.3.0 0 2025-05-19
9.2.1 0 2025-04-24
9.2.0 0 2025-04-10
9.1.0 0 2025-02-25
9.0.0 0 2024-11-12
9.0.0-rc.1.24511.1 0 2024-10-15
8.2.2 0 2024-10-24
8.2.1 0 2024-09-26
8.2.0 0 2024-08-29
8.1.0 0 2024-07-23
8.0.2 0 2024-06-28
8.0.1 0 2024-05-21
8.0.0 0 2024-05-21
8.0.0-preview.7.24251.11 0 2024-05-07
8.0.0-preview.6.24214.1 0 2024-04-23
8.0.0-preview.5.24201.12 0 2024-04-09