CosmosClientBuilder.preferredRegions(List<String> preferredRegions) Method

Definition

Sets the preferred regions for geo-replicated database accounts. For example, "East US" as the preferred region.

When EnableEndpointDiscovery is true and PreferredRegions is non-empty, the SDK will prefer to use the regions in the container in the order they are specified to perform operations.

If EnableEndpointDiscovery is set to false, this property is ignored.

public CosmosClientBuilder preferredRegions(List<String> preferredRegions)

Parameters

preferredRegions
java.util.List<java.lang.String>

the list of preferred regions.

Returns

current CosmosClientBuilder

Applies to