CosmosClientBuilder.WithApplicationRegion(String) 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.
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
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Azure SDK for .NET