Skip to main content
net8.0net9.0net10.0

A Milvus client that integrates with Aspire, including logging.

Published
Apr 24, 2026
5mo ago
Total Downloads
9.6K
9,626

Install

dotnet add package Aspire.Milvus.Client --version 13.2.4-preview.1.26224.4
ProductVersions
.NET
net10.0net8.0net9.0

README

Aspire.Milvus.Client library

Registers a MilvusClient in the DI container for connecting to a Milvus server.

Getting started

Prerequisites

  • Milvus server and connection string for accessing the server API endpoint.

Install the package

Install the Aspire Milvus Client library with NuGet:

dotnet add package Aspire.Milvus.Client

Usage example

In the AppHost.cs file of your project, call the AddMilvusClient extension method to register a MilvusClient for use via the dependency injection container. The method takes a connection name parameter.

builder.AddMilvusClient("milvus");

Configuration

The Aspire Milvus Client component provides multiple options to configure the server connection based on the requirements and conventions of your project.

Use a connection string

When using a connection string from the ConnectionStrings configuration section, you can provide the name of the connection string when calling builder.AddMilvusClient():

builder.AddMilvusClient("milvus");

And then the connection string will be retrieved from the ConnectionStrings configuration section:

{
  "ConnectionStrings": {
    "milvus": "Endpoint=http://localhost:19530/;Key=root:123456!@#$%"
  }
}

By default the MilvusClient uses the gRPC API endpoint.

Use configuration providers

The Aspire Milvus Client component supports Microsoft.Extensions.Configuration. It loads the MilvusSettings from configuration by using the Aspire:Milvus:Client key. Example appsettings.json that configures some of the options:

{
  "Aspire": {
    "Milvus": {
      "Client": {
        "Key": "root:123456!@#$%"
      }
    }
  }
}

Use inline delegates

Also you can pass the Action<MilvusSettings> configureSettings delegate to set up some or all the options inline, for example to set the API key from code:

builder.AddMilvusClient("milvus", settings => settings.Key = "root:12345!@#$%");

AppHost extensions

In your AppHost project, install the Aspire.Hosting.Milvus library with NuGet:

dotnet add package Aspire.Hosting.Milvus

Then, in the AppHost.cs file of AppHost, register a Milvus server and consume the connection using the following methods:

var milvus = builder.AddMilvus("milvus");

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

The WithReference method configures a connection in the MyService project named milvus. In the Program.cs file of MyService, the Milvus connection can be consumed using:

builder.AddMilvusClient("milvus");

Additional documentation

Feedback & contributing

https://github.com/microsoft/aspire

*Milvus and the Milvus logo are used with permission from the Milvus project. All rights reserved by LF AI & Data foundation.

Changes from Previous Version

No structural changes between v13.2.3-preview.1.26217.6 and v13.2.4-preview.1.26224.4.

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 3 target frameworks; confirm the exact target used by your application.The published metadata declares 30 direct dependency entries across framework groups. Inspect the resolved dependency graph for your target framework.

Related Guides & Workflows

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