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: articles/synapse-analytics/quickstart-connect-synapse-link-cosmos-db.md
+10-5Lines changed: 10 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
-
title: Connect to Synapse Link for Cosmos DB
3
-
description: How to connect a Cosmos DB to a Synapse workspace with Synapse Link
2
+
title: Connect to Synapse Link for Azure Cosmos DB
3
+
description: How to connect a Azure Cosmos DB to a Synapse workspace with Synapse Link
4
4
services: synapse-analytics
5
5
author: ArnoMicrosoft
6
6
ms.service: synapse-analytics
@@ -24,7 +24,11 @@ Before you connect an Azure Cosmos DB account to your workspace, there are a few
24
24
25
25
## Enable Azure Cosmos DB analytical store
26
26
27
-
To run large-scale analytics into Azure Cosmos DB without impacting your operational performance, we recommend enabling Synapse Link for Azure Cosmos DB which bring HTAP capability to a container and built-in support in Azure Synapse. Follow this quickstart to enable Synapse Link for Cosmos DB containers.
27
+
To run large-scale analytics into Azure Cosmos DB without impacting your operational performance, we recommend enabling Synapse Link for Azure Cosmos DB which bring HTAP capability to a container and built-in support in Azure Synapse. Follow this quickstart to enable Synapse Link for Cosmos DB containers.
28
+
29
+
## Navigate to Synapse Studio
30
+
31
+
From your Synapse workspace, select **Launch Synapse Studio**. On the Synapse Studio home page, select **Data** which will take you to the **Data Object Explorer**.
28
32
29
33
## Connect an Azure Cosmos DB database to a Synapse workspace
30
34
@@ -37,7 +41,7 @@ From the Data Object Explorer, you can directly connect an Azure Cosmos DB datab
37
41
4. Select ***Continue***
38
42
5. Name the linked service. The name will be displayed in the Object Explorer and used by Synapse run-times to connect to the database and containers. We recommend using a friendly name.
39
43
6. Select the **Cosmos DB account name** and **database name**
40
-
7. (Optional) If no region is specified, Synapse run-time operations will be routed toward the nearest region where the analytical store is enabled. However you can set manually which region you want your users to access Cosmos DB analytical store. Select **Additional connection properties** and then **New**. Under **Property Name**, write ***PreferredRegions*** and set the **Value** to the region you want (example: WestUS2, there is no space between words and number)
44
+
7. (Optional) If no region is specified, Synapse run-time operations will be routed toward the nearest region where the analytical store is enabled. However, you can set manually which region you want your users to access Cosmos DB analytical store. Select **Additional connection properties** and then **New**. Under **Property Name**, write ***PreferredRegions*** and set the **Value** to the region you want (example: WestUS2, there is no space between words and number)
41
45
8. Select ***Create***
42
46
43
47
Azure Cosmos DB database are visible under the tab **Linked** in the Azure Cosmos DB section. You can differentiate an HTAP enabled Azure Cosmos DB container from an OLTP only container with the following icons:
@@ -56,4 +60,5 @@ By right-clicking into a container, you have list of gestures that will trigger
56
60
57
61
## Next steps
58
62
59
-
*[Learn what is supported between Synapse and Azure Cosmos DB](./synapse-link/concept-synapse-link-cosmos-db-support.md)
63
+
*[Learn what is supported between Synapse and Azure Cosmos DB](./synapse-link/concept-synapse-link-cosmos-db-support.md)
64
+
*[Learn how to query an analytical store with Synapse Spark](synapse-link/how-to-query-analytical-store-spark.md)
|**Run-time Support**|Support for read or write by Azure Synapse run-time| ✓ |[Contact Us](mailto:[email protected]?subject=[Enable%20Preview%20Feature]%20SQL%20serverless%20for%20Cosmos%20DB)|
31
31
|**Cosmos DB API support**|API support as a Synapse Link| SQL / Mongo DB | SQL / Mongo DB |
32
32
|**Object**|Objects such as table that can be created, pointing directly to Azure Cosmos DB container| View, Table | View |
@@ -39,7 +39,7 @@ Here is list of the currently supported features within Synapse Link for Cosmos
Copy file name to clipboardExpand all lines: articles/synapse-analytics/synapse-link/how-to-query-analytical-store-spark.md
+57-2Lines changed: 57 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: Query Cosmos DB analytical with Synapse Spark
2
+
title: Query Azure Cosmos DB analytical store with Synapse Spark
3
3
description: How to query Cosmos DB analytical with Synapse Spark
4
4
services: synapse-analytics
5
5
author: ArnoMicrosoft
@@ -11,7 +11,7 @@ ms.author: acomet
11
11
ms.reviewer: jrasnick
12
12
---
13
13
14
-
# Query Cosmos DB analytical with Synapse Spark
14
+
# Query Azure Cosmos DB analytical store with Synapse Spark
15
15
16
16
This article gives some examples on how you can interact with the analytical store from Synapse gestures. Gestures are visible when you right-click on a container. With gestures, you can quickly generate code and tailor it to your needs. They are also perfect for discovering data with a single click.
In this gesture, you will create a Spark table pointing to the container you selected. That operation does not incur any data movement. If you decide to delete that table, the underlying container (and corresponding analytical store) won't be impacted.
In this gesture, you will use Spark Streaming capability to load data from a container into a dataframe. The data will be stored into the primary data lake account (and file system) that you connected to the workspace.
71
95
@@ -85,6 +109,21 @@ dfStream = spark.readStream\
85
109
.load()
86
110
```
87
111
112
+
The equivalent code gesture in **Scala** would be the following code:
113
+
```java
114
+
// To select a preferred list of regions in a multi-region Cosmos DB account, add .option("spark.cosmos.preferredRegions", "<Region1>,<Region2>")
In this gesture, you will write a streaming dataframe into the Cosmos DB container you selected. If the folder */localReadCheckpointFolder* is not created, it will be automatically created. This operation will impact the transactional performance of Cosmos DB.
90
129
@@ -104,6 +143,22 @@ streamQuery = dfStream\
104
143
streamQuery.awaitTermination()
105
144
```
106
145
146
+
The equivalent code gesture in **Scala** would be the following code:
147
+
```java
148
+
// To select a preferred list of regions in a multi-region Cosmos DB account, add .option("spark.cosmos.preferredRegions", "<Region1>,<Region2>")
0 commit comments