CosmosOptions.ConfigureCosmosClient Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
ConfigureCosmosClient(Func<IServiceProvider,ValueTask<CosmosClient>>) |
Configures the Cosmos DB client. |
ConfigureCosmosClient(String) |
Configures the Cosmos DB client. |
ConfigureCosmosClient(String, AzureKeyCredential) |
Configures the Cosmos DB client. |
ConfigureCosmosClient(String, TokenCredential) |
Configures the Cosmos DB client. |
ConfigureCosmosClient(String, String) |
Configures the Cosmos DB client. |
ConfigureCosmosClient(Func<IServiceProvider,ValueTask<CosmosClient>>)
Configures the Cosmos DB client.
public void ConfigureCosmosClient(Func<IServiceProvider,System.Threading.Tasks.ValueTask<Microsoft.Azure.Cosmos.CosmosClient>> createClient);
member this.ConfigureCosmosClient : Func<IServiceProvider, System.Threading.Tasks.ValueTask<Microsoft.Azure.Cosmos.CosmosClient>> -> unit
Public Sub ConfigureCosmosClient (createClient As Func(Of IServiceProvider, ValueTask(Of CosmosClient)))
Parameters
- createClient
- Func<IServiceProvider,ValueTask<CosmosClient>>
The delegate used to create the Cosmos DB client.
Applies to
ConfigureCosmosClient(String)
Configures the Cosmos DB client.
public void ConfigureCosmosClient(string connectionString);
member this.ConfigureCosmosClient : string -> unit
Public Sub ConfigureCosmosClient (connectionString As String)
Parameters
- connectionString
- String
The connection string.
Applies to
ConfigureCosmosClient(String, AzureKeyCredential)
Configures the Cosmos DB client.
public void ConfigureCosmosClient(string accountEndpoint, Azure.AzureKeyCredential authKeyOrResourceTokenCredential);
member this.ConfigureCosmosClient : string * Azure.AzureKeyCredential -> unit
Public Sub ConfigureCosmosClient (accountEndpoint As String, authKeyOrResourceTokenCredential As AzureKeyCredential)
Parameters
- accountEndpoint
- String
The account endpoint. In the form of https://{databaseaccount}.documents.azure.com:443/
, https://learn.microsoft.com/rest/api/cosmos-db/cosmosdb-resource-uri-syntax-for-rest
- authKeyOrResourceTokenCredential
- AzureKeyCredential
AzureKeyCredential with master-key or resource token.
Applies to
ConfigureCosmosClient(String, TokenCredential)
Configures the Cosmos DB client.
public void ConfigureCosmosClient(string accountEndpoint, Azure.Core.TokenCredential tokenCredential);
member this.ConfigureCosmosClient : string * Azure.Core.TokenCredential -> unit
Public Sub ConfigureCosmosClient (accountEndpoint As String, tokenCredential As TokenCredential)
Parameters
- accountEndpoint
- String
The account endpoint. In the form of https://{databaseaccount}.documents.azure.com:443/
, https://learn.microsoft.com/rest/api/cosmos-db/cosmosdb-resource-uri-syntax-for-rest
- tokenCredential
- TokenCredential
The token to provide AAD for authorization.
Applies to
ConfigureCosmosClient(String, String)
Configures the Cosmos DB client.
public void ConfigureCosmosClient(string accountEndpoint, string authKeyOrResourceToken);
member this.ConfigureCosmosClient : string * string -> unit
Public Sub ConfigureCosmosClient (accountEndpoint As String, authKeyOrResourceToken As String)
Parameters
- accountEndpoint
- String
The account endpoint. In the form of https://{databaseaccount}.documents.azure.com:443/
, 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.