# MilvusServerResource

- Module: [Aspire.Hosting.Milvus](/reference/api/typescript/aspire.hosting.milvus.md)
- Version: `13.4.0`
- Kind: `handle`
- Source: [GitHub](https://github.com/microsoft/aspire)

A resource that represents a Milvus database.

## Definition

```typescript
interface MilvusServerResource
  extends IComputeResource,
    IExpressionValue,
    IManifestExpressionProvider,
    IResource,
    IResourceWithArgs,
    IResourceWithConnectionString,
    IResourceWithEndpoints,
    IResourceWithEnvironment,
    IResourceWithProbes,
    IResourceWithWaitSupport,
    IValueProvider,
    IValueWithReferences {
  readonly apiKeyParameter: ParameterResource;
  readonly connectionStringExpression: ReferenceExpression;
  readonly databases: Dict<string,string>;
  readonly host: EndpointReferenceExpression;
  readonly port: EndpointReferenceExpression;
  readonly primaryEndpoint: EndpointReference;
  readonly token: ReferenceExpression;
  readonly uriExpression: ReferenceExpression;
  addDatabase(
      name: string,
      databaseName?: string): MilvusDatabaseResource;
  withAttu(configureContainer?: (obj: AttuResource) => Promise<void>, containerName?: string): MilvusServerResource;
  withConfigurationFile(configurationFilePath: string): MilvusServerResource;
  withDataBindMount(
      source: string,
      isReadOnly?: boolean): MilvusServerResource;
  withDataVolume(
      name?: string,
      isReadOnly?: boolean): MilvusServerResource;
}
```

## Properties

- `apiKeyParameter`: `ParameterResource` `get` -- Gets the parameter that contains the Milvus API key.
- `connectionStringExpression`: `ReferenceExpression` `get` -- Gets the connection string expression for the Milvus gRPC endpoint.
- `databases`: `Dict<string,string>` `get` -- A dictionary where the key is the resource name and the value is the database name.
- `host`: `EndpointReferenceExpression` `get` -- Gets the host endpoint reference for this resource.
- `port`: `EndpointReferenceExpression` `get` -- Gets the port endpoint reference for this resource.
- `primaryEndpoint`: `EndpointReference` `get` -- Gets the gRPC endpoint for the Milvus database.
- `token`: `ReferenceExpression` `get` -- Gets a valid access token to access the Milvus instance.
- `uriExpression`: `ReferenceExpression` `get` -- Gets URI expression for the Milvus instance.

## Methods

- [addDatabase](/reference/api/typescript/aspire.hosting.milvus/milvusserverresource/adddatabase.md) -- `method` -- Adds a Milvus database to the application model.
    ```typescript
  addDatabase(name: string, databaseName?: string): MilvusDatabaseResource
  ```
- [withAttu](/reference/api/typescript/aspire.hosting.milvus/milvusserverresource/withattu.md) -- `method` -- Adds an administration and development platform for Milvus to the application model using Attu.
    ```typescript
  withAttu(configureContainer?: (obj: AttuResource) => Promise<void>, containerName?: string): MilvusServerResource
  ```
- [withConfigurationFile](/reference/api/typescript/aspire.hosting.milvus/milvusserverresource/withconfigurationfile.md) -- `method` -- Copies a configuration file into a Milvus container resource.
    ```typescript
  withConfigurationFile(configurationFilePath: string): MilvusServerResource
  ```
- [withDataBindMount](/reference/api/typescript/aspire.hosting.milvus/milvusserverresource/withdatabindmount.md) -- `method` -- Adds a bind mount for the data folder to a Milvus container resource.
    ```typescript
  withDataBindMount(source: string, isReadOnly?: boolean): MilvusServerResource
  ```
- [withDataVolume](/reference/api/typescript/aspire.hosting.milvus/milvusserverresource/withdatavolume.md) -- `method` -- Adds a named volume for the data folder to a Milvus container resource.
    ```typescript
  withDataVolume(name?: string, isReadOnly?: boolean): MilvusServerResource
  ```
