Skip to main content
Total Downloads
4.3K
4,334
Published
Apr 28, 2026
6mo ago

Get Started

dotnet add package Couchbase.Aspire.Hosting.Indices --version 1.0.0-beta.5
ProductVersions
.NET
net8.0

README

Couchbase.Aspire.Hosting.Indices library

Provides extension methods and resource definitions to add index management to a Couchbase cluster resource in an Aspire AppHost.

Getting Started

Install the package

dotnet add package Couchbase.Aspire.Hosting.Indices

Usage example

In the AppHost.cs file of your AppHost, add indices to a Couchbase bucket resource using the following methods:

var couchbase = builder.AddCouchbase("couchbase");
var bucket = couchbase.AddBucket("mybucket")
    .WithIndices("../indices");

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

Waiting for indices to be ready

It is also possible to wait for the indices to be applied before starting your application:

var couchbase = builder.AddCouchbase("couchbase");
var bucket = couchbase.AddBucket("mybucket");

var bucketIndices = bucket.AddIndexManager("mybucket-indices")
    .WithIndices("../indices");

var myService = builder.AddProject<Projects.MyService>()
    .WithReference(bucket)
    .WaitFor(bucket)
    .WaitForCompletion(bucketIndices);

Index definition files

Index definition files are JSON or YAML files that define the indexes to be created on a Couchbase bucket. They may be referenced by directory or by individual file. See couchbase-index-manager Documentation for details on the file format.

Using with a secure Couchbase cluster

If your Couchbase cluster uses TLS/SSL, you may need to configure the index manager to trust the cluster's certificate.

var certAuthorityCollection = builder.AddCertificateAuthorityCollection("couchbase-cert-authority")
    .WithCertificate(certificateWithPrivateKey);

var couchbase = builder.AddCouchbase("couchbase");
var bucket = couchbase.AddBucket("mybucket")
    .WithRootCertificateAuthority(certAuthorityCollection); // Use the certificate for the Couchbase cluster

var bucketIndices = bucket.AddIndexManager("mybucket-indices")
    .WithIndices("../indices")
    .WithCertificateAuthorityCollection(certAuthorityCollection); // Trust the certificate for index management

var myService = builder.AddProject<Projects.MyService>()
    .WithReference(bucket)
    .WaitFor(bucket)
    .WaitForCompletion(bucketIndices);

Feedback & contributing

https://github.com/couchbaselabs/couchbase-aspire

Downloads by Version

Similar & Alternative Packages

Hand-picked matching NuGet libraries based on tags & ecosystem

Depended On By

Find packages that declare this package as a dependency. NuGet does not provide a reverse-dependency endpoint, so candidates are checked on demand.

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

This version is marked prerelease. Validate its API and upgrade path before production use.Compatibility metadata lists 1 target framework; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.