Skip to content

Commit 3300fd0

Browse files
authored
Merge pull request #190574 from Venkat1340/Users/Venkat1340/Includespark
MSDocs: Include Spark way of setting preferred region
2 parents c387e6d + 789b162 commit 3300fd0

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

articles/cosmos-db/sql/tutorial-global-distribution-sql-api.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ms.author: mjbrown
66
ms.service: cosmos-db
77
ms.subservice: cosmosdb-sql
88
ms.topic: tutorial
9-
ms.date: 08/26/2021
9+
ms.date: 04/03/2022
1010
ms.reviewer: sngun
1111
ms.custom: devx-track-python, devx-track-js, devx-track-csharp
1212

@@ -174,6 +174,19 @@ The following code shows how to set preferred locations by using the Java SDK:
174174

175175
---
176176

177+
## Spark 3 Connector
178+
179+
You can define the preferred regional list using the `spark.cosmos.preferredRegionsList` [configuration](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/cosmos/azure-cosmos-spark_3_2-12/docs/configuration-reference.md), for example:
180+
181+
```scala
182+
val sparkConnectorConfig = Map(
183+
"spark.cosmos.accountEndpoint" -> cosmosEndpoint,
184+
"spark.cosmos.accountKey" -> cosmosMasterKey,
185+
"spark.cosmos.preferredRegionsList" -> "[West US, East US, North Europe]"
186+
// other settings
187+
)
188+
```
189+
177190
## REST
178191

179192
Once a database account has been made available in multiple regions, clients can query its availability by performing a GET request on this URI `https://{databaseaccount}.documents.azure.com/`

0 commit comments

Comments
 (0)