Couchbase.Aspire.Hosting
1.0.0-alpha.4
Prefix Reserved
dotnet add package Couchbase.Aspire.Hosting --version 1.0.0-alpha.4
NuGet\Install-Package Couchbase.Aspire.Hosting -Version 1.0.0-alpha.4
<PackageReference Include="Couchbase.Aspire.Hosting" Version="1.0.0-alpha.4" />
<PackageVersion Include="Couchbase.Aspire.Hosting" Version="1.0.0-alpha.4" />
<PackageReference Include="Couchbase.Aspire.Hosting" />
paket add Couchbase.Aspire.Hosting --version 1.0.0-alpha.4
#r "nuget: Couchbase.Aspire.Hosting, 1.0.0-alpha.4"
#:package Couchbase.Aspire.Hosting@1.0.0-alpha.4
#addin nuget:?package=Couchbase.Aspire.Hosting&version=1.0.0-alpha.4&prerelease
#tool nuget:?package=Couchbase.Aspire.Hosting&version=1.0.0-alpha.4&prerelease
Couchbase.Aspire.Hosting library
Provides extension methods and resource definitions for an Aspire AppHost to configure a Couchbase cluster resource.
Getting Started
Install the package
dotnet add package Couchbase.Aspire.Hosting
Usage example
In the AppHost.cs file of your AppHost, add a Couchbase cluster resource with the data, query, and index services
and consume the connection using the following methods:
var couchbase = builder.AddCouchbase("couchbase");
var bucket = couchbase.AddBucket("mybucket");
var myService = builder.AddProject<Projects.MyService>()
.WithReference(bucket)
.WaitFor(bucket);
Multi-dimensional scaling example
It is also possible to run a multiple server cluster with various services assigned to different server groups:
var couchbase = builder.AddCouchbase("couchbase");
var bucket1 = couchbase.AddBucket("bucket1");
var group1 = couchbase.AddServerGroup("couchbase-group1")
.WithServices(CouchbaseServices.Data)
.WithReplicas(2);
var group2 = couchbase.AddServerGroup("couchbase-group2")
.WithServices(CouchbaseServices.Index | CouchbaseServices.Query)
.WithReplicas(2);
var myService = builder.AddProject<Projects.MyService>()
.WithReference(bucket)
.WaitFor(bucket);
Connection properties
When you reference a Couchbase cluster resource using WithReference, the following connection properties are made available to the consuming project:
Couchbase cluster
The Couchbase cluster resource exposes the following connection properties:
| Property Name | Description |
|---|---|
Username |
The username for authentication |
Password |
The password for authentication |
Uri |
The connection URI, with the format couchbase://{Host}:{Port},{Host2}:{Port} or couchbases://{Host}:{Port},{Host2}:{Port} |
The ConnectionString property is also available, which exposes all properties as a single string in the format couchbase://{Username}:{Password}@{Host}:{Port},{Host2}:{Port}.
Couchbase bucket
The Couchbase bucket resource exposes the following connection properties:
| Property Name | Description |
|---|---|
Username |
The username for authentication |
Password |
The password for authentication |
Uri |
The connection URI, with the format couchbase://{Host}:{Port},{Host2}:{Port} or couchbases://{Host}:{Port},{Host2}:{Port} |
BucketName |
The name of the bucket |
The ConnectionString property is also available, which exposes all properties as a single string in the format couchbase://{Username}:{Password}@{Host}:{Port},{Host2}:{Port}/{BucketName}.
Feedback & contributing
| Product | Versions 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 was computed. 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 was computed. 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. |
-
net8.0
- Aspire.Hosting (>= 13.1.0)
- Couchbase.HealthChecks (>= 1.0.0-alpha.4)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Couchbase.Aspire.Hosting:
| Package | Downloads |
|---|---|
|
Couchbase.Aspire.Hosting.Indices
Couchbase Index Manager support for Aspire. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0-alpha.4 | 44 | 1/25/2026 |
| 1.0.0-alpha.3 | 50 | 1/19/2026 |
| 1.0.0-alpha.2 | 46 | 1/17/2026 |
| 1.0.0-alpha.1 | 46 | 1/16/2026 |