Udostępnij za pośrednictwem


CosmosClientBuilder.WithApplicationRegion(String) Method

Definition

Set the preferred geo-replicated region to be used in the Azure Cosmos DB service.

public Microsoft.Azure.Cosmos.Fluent.CosmosClientBuilder WithApplicationRegion (string applicationRegion);
member this.WithApplicationRegion : string -> Microsoft.Azure.Cosmos.Fluent.CosmosClientBuilder
Public Function WithApplicationRegion (applicationRegion As String) As CosmosClientBuilder

Parameters

applicationRegion
String

Azure region where application is running. Regions lists valid Cosmos DB regions.

Returns

The current CosmosClientBuilder.

Examples

The example below creates a new CosmosClientBuilder with a of preferred region.

CosmosClientBuilder cosmosClientBuilder = new CosmosClientBuilder(
    accountEndpoint: "https://testcosmos.documents.azure.com:443/",
    authKeyOrResourceToken: "SuperSecretKey")
.WithApplicationRegion("East US 2");
CosmosClient client = cosmosClientBuilder.Build();

Applies to

See also