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
Azure SDK for .NET
Обратная связь
https://aka.ms/ContentUserFeedback.
Ожидается в ближайшее время: в течение 2024 года мы постепенно откажемся от GitHub Issues как механизма обратной связи для контента и заменим его новой системой обратной связи. Дополнительные сведения см. в разделеОтправить и просмотреть отзыв по