跳转到内容
文档试用 Aspire
文档试用

Use community extensions for Redis hosting

此内容尚不支持你的语言。

⭐ Community Toolkit Redis logo

The Aspire Community Toolkit Redis hosting extensions package provides extra functionality to the Aspire.Hosting.Redis hosting package. These extensions are built and maintained by the community and are separate from the official Redis integration.

This package provides the following features:

  • DbGate management UI
  • dbx management UI

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

Aspire CLI — 添加 CommunityToolkit.Aspire.Hosting.Redis.Extensions 包
aspire add communitytoolkit-redis-extensions

Aspire CLI 是交互式的;按提示选择合适的搜索结果:

Aspire CLI — 输出示例
Select an integration to add:
> communitytoolkit-redis-extensions (CommunityToolkit.Aspire.Hosting.Redis.Extensions)
> Other results listed as selectable options...

To add the DbGate management UI, decorate the official Redis resource with WithDbGate / withDbGate:

AppHost.cs
var builder = DistributedApplication.CreateBuilder(args);
var redis = builder.AddRedis("redis")
.WithDbGate();
builder.AddProject<Projects.ExampleProject>("example-project")
.WithReference(redis);
builder.Build().Run();

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 Redis databases.

dbx is a lightweight, web-based database client and an alternative management UI to DbGate and Adminer. Decorate the Redis resource with WithDbx / withDbx to add it:

AppHost.cs
var builder = DistributedApplication.CreateBuilder(args);
var redis = builder.AddRedis("redis")
.WithDbx();
builder.Build().Run();

The C# overload accepts an optional container configuration callback and containerName. The TypeScript binding accepts optional containerName and imageTag values.