# FlociAzureContainerResource.WithCosmos

- Module: [CommunityToolkit.Aspire.Hosting.Floci](/reference/api/go/communitytoolkit.aspire.hosting.floci.md)
- Defined on: [FlociAzureContainerResource](/reference/api/go/communitytoolkit.aspire.hosting.floci/flociazurecontainerresource.md)
- Version: `13.6.1`
- Kind: `method`

Adds a Cosmos DB child resource to the Floci Azure emulator

## Remarks

Reference the returned resource with Aspire's standard `WithReference` API to inject its
Cosmos DB connection string. floci-az serves the Cosmos SQL/NoSQL API from the parent
resource's endpoint under the `{account}-cosmos` path.

## Definition

```go
type FlociAzureContainerResource interface {
    // ... omitted for brevity
    WithCosmos(options ...*WithCosmosOptions) FlociAzureCosmosResource
}
```

## Signature

```go
WithCosmos(options ...*WithCosmosOptions) FlociAzureCosmosResource
```

## Parameters

- `options` (`...*WithCosmosOptions`) -- optional settings, see [Options](#options)

## Options

Optional parameters are passed in a trailing `options ...*WithCosmosOptions` argument.

- `Name` (`*string`) -- The name of the Cosmos DB resource (default: `cosmos`).
- `AccountName` (`*string`) -- The Cosmos account name segment (default: `devstoreaccount1`).

## Returns

[`FlociAzureCosmosResource`](/reference/api/go/communitytoolkit.aspire.hosting.floci/flociazurecosmosresource.md) -- A reference to the `IResourceBuilder` for further configuration.

Returns a handle; failures surface later via `Err()`.

## Defined on

- [FlociAzureContainerResource](/reference/api/go/communitytoolkit.aspire.hosting.floci/flociazurecontainerresource.md) -- `handle`
