# CosmosOptions Methods

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.reminders.cosmos/orleans.reminders.cosmos.cosmosoptions/)

## ConfigureCosmosClient(Func&lt;IServiceProvider, ValueTask&lt;CosmosClient&gt;&gt;) {#configurecosmosclient-system-func-system-iserviceprovider-system-threading-tasks-c002f269}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.reminders.cosmos/orleans.reminders.cosmos.cosmosoptions/methods/configurecosmosclient-system-func-system-iserviceprovider-system-threading-tasks-c002f269/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Azure/Shared/Cosmos/CosmosOptions.cs#L116-L117)

```csharp
public void ConfigureCosmosClient(Func<IServiceProvider, ValueTask<CosmosClient>> createClient)
```

Configures the Cosmos DB client.

### Parameters

- `createClient` (`Func<IServiceProvider, ValueTask<CosmosClient>>`): The delegate used to create the Cosmos DB client.

## ConfigureCosmosClient(string, AzureKeyCredential) {#configurecosmosclient-string-azure-azurekeycredential-782d5798}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.reminders.cosmos/orleans.reminders.cosmos.cosmosoptions/methods/configurecosmosclient-string-azure-azurekeycredential-782d5798/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Azure/Shared/Cosmos/CosmosOptions.cs#L85-L86)

```csharp
public void ConfigureCosmosClient(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential)
```

Configures the Cosmos DB client.

### Parameters

- `accountEndpoint` (`string`): The account endpoint. In the form of 

```csharp
https://{databaseaccount}.documents.azure.com:443/
```

, [https://learn.microsoft.com/rest/api/cosmos-db/cosmosdb-resource-uri-syntax-for-rest](https://learn.microsoft.com/rest/api/cosmos-db/cosmosdb-resource-uri-syntax-for-rest)
- `authKeyOrResourceTokenCredential` (`AzureKeyCredential`): `Azure.AzureKeyCredential` with master-key or resource token.

## ConfigureCosmosClient(string, TokenCredential) {#configurecosmosclient-string-azure-core-tokencredential-31411203}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.reminders.cosmos/orleans.reminders.cosmos.cosmosoptions/methods/configurecosmosclient-string-azure-core-tokencredential-31411203/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Azure/Shared/Cosmos/CosmosOptions.cs#L96-L97)

```csharp
public void ConfigureCosmosClient(string accountEndpoint, TokenCredential tokenCredential)
```

Configures the Cosmos DB client.

### Parameters

- `accountEndpoint` (`string`): The account endpoint. In the form of 

```csharp
https://{databaseaccount}.documents.azure.com:443/
```

, [https://learn.microsoft.com/rest/api/cosmos-db/cosmosdb-resource-uri-syntax-for-rest](https://learn.microsoft.com/rest/api/cosmos-db/cosmosdb-resource-uri-syntax-for-rest)
- `tokenCredential` (`TokenCredential`): The token to provide AAD for authorization.

## ConfigureCosmosClient(string, string) {#configurecosmosclient-string-string-b4d45115}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.reminders.cosmos/orleans.reminders.cosmos.cosmosoptions/methods/configurecosmosclient-string-string-b4d45115/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Azure/Shared/Cosmos/CosmosOptions.cs#L107-L108)

```csharp
public void ConfigureCosmosClient(string accountEndpoint, string authKeyOrResourceToken)
```

Configures the Cosmos DB client.

### Parameters

- `accountEndpoint` (`string`): The account endpoint. In the form of 

```csharp
https://{databaseaccount}.documents.azure.com:443/
```

, [https://learn.microsoft.com/rest/api/cosmos-db/cosmosdb-resource-uri-syntax-for-rest](https://learn.microsoft.com/rest/api/cosmos-db/cosmosdb-resource-uri-syntax-for-rest)
- `authKeyOrResourceToken` (`string`): The Cosmos account key or resource token to use to create the client.

## ConfigureCosmosClient(string) {#configurecosmosclient-string-b6dc50ea}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.reminders.cosmos/orleans.reminders.cosmos.cosmosoptions/methods/configurecosmosclient-string-b6dc50ea/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Azure/Shared/Cosmos/CosmosOptions.cs#L74-L75)

```csharp
public void ConfigureCosmosClient(string connectionString)
```

Configures the Cosmos DB client.

### Parameters

- `connectionString` (`string`): The connection string.
