Gå til indhold

SQL Server hosting extensions

Dette indhold er ikke tilgængeligt i dit sprog endnu.

⭐ Community Toolkit SQL Server logo

The Aspire Community Toolkit SQL Server hosting extensions package provides extra functionality to the Aspire.Hosting.SqlServer hosting package.

This package provides the following features:

To get started with the Aspire Community Toolkit SQL Server hosting extensions, install the CommunityToolkit.Aspire.Hosting.SqlServer.Extensions NuGet package in the app host project.

Aspire CLI — Tilføj CommunityToolkit.Aspire.Hosting.SqlServer.Extensions-pakke
aspire add communitytoolkit-sqlserver-extensions

Aspire CLI er interaktiv; vælg det passende søgeresultat når du bliver spurgt:

Aspire CLI — Eksempel output
Select an integration to add:
> communitytoolkit-sqlserver-extensions (CommunityToolkit.Aspire.Hosting.SqlServer.Extensions)
> Other results listed as selectable options...

To add the DbGate management UI to your SQL Server resource, call the WithDbGate method on the SqlServerResourceBuilder instance:

C# — AppHost.cs
var builder = DistributedApplication.CreateBuilder(args);
var sqlserver = builder.AddSqlServer("sqlserver")
.WithDbGate();
builder.AddProject<Projects.ExampleProject>()
.WithReference(sqlserver);
// After adding all resources, run the app...

This adds a new DbGate resource to the app host which is available from the Aspire dashboard. DbGate is a comprehensive database management tool that provides a web-based interface for managing your SQL Server databases.

To add the Adminer management UI to your SQL Server resource, call the WithAdminer method on the SqlServerResourceBuilder instance:

C# — AppHost.cs
var builder = DistributedApplication.CreateBuilder(args);
var sqlserver = builder.AddSqlServer("sqlserver")
.WithAdminer();
builder.AddProject<Projects.ExampleProject>()
.WithReference(sqlserver);
// After adding all resources, run the app...

This adds a new Adminer resource to the app host which is available from the Aspire dashboard. Adminer is a lightweight database management tool that provides a simple web interface for database operations.

You can use both management UIs together on the same SQL Server resource:

C# — AppHost.cs
var builder = DistributedApplication.CreateBuilder(args);
var sqlserver = builder.AddSqlServer("sqlserver")
.WithDbGate()
.WithAdminer();
builder.AddProject<Projects.ExampleProject>()
.WithReference(sqlserver);
// After adding all resources, run the app...
Spørg & svarSamarbejdFællesskabDiskutérSe