You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: sdk/cosmos/azure-cosmos/README.md
+19Lines changed: 19 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -110,6 +110,25 @@ Always ensure that the managed identity you use for AAD authentication has `read
110
110
More information on how to set up AAD authentication: [Set up RBAC for AAD authentication](https://learn.microsoft.com/azure/cosmos-db/how-to-setup-rbac) <br>
111
111
More information on allowed operations for AAD authenticated clients: [RBAC Permission Model](https://aka.ms/cosmos-native-rbac)
112
112
113
+
### Preferred Locations
114
+
To enable multi-region support in CosmosClient, set the `preferred_locations` parameter.
115
+
By default, all writes and reads go to the dedicated write region unless specified otherwise.
116
+
The `preferred_locations` parameter accepts a list of regions for read requests.
117
+
Requests are sent to the first region in the list, and if it fails, they move to the next region.
118
+
119
+
For example, to set West US as the read region, and Central US as the backup read region, the code would look like this:
Also note that if all regions listed in preferred locations fail, read requests are sent to the main write region.
129
+
For example if the write region is set to East US, then `preferred_locations=["West US", "Central US"]`
130
+
is equivalent to `preferred_locations=["West US", "Central US", "East US"]` since the client will send all requests to the write region if the preferred locations fail.
131
+
113
132
## Key concepts
114
133
115
134
Once you've initialized a [CosmosClient][ref_cosmosclient], you can interact with the primary resource types in Cosmos DB:
0 commit comments