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
+12-7Lines changed: 12 additions & 7 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 an 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. This function brings 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,10 +41,10 @@ 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 numbers)
41
45
8. Select ***Create***
42
46
43
-
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:
47
+
Azure Cosmos DB databases 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:
44
48
45
49
**Synapse container**:
46
50
@@ -52,8 +56,9 @@ Azure Cosmos DB database are visible under the tab **Linked** in the Azure Cosmo
52
56
53
57
## Quickly interact with code-generated actions
54
58
55
-
By right-clicking into a container, you have list of gestures that will trigger a Spark or SQL run-time. Writing into a container will happen through the Transactional Store of Azure Cosmos DB and will consume Request Units.
59
+
When you right-click into a container, you'll have a list of gestures that will trigger a Spark or SQL run-time. Writing into a container will happen through the Transactional Store of Azure Cosmos DB and will consume Request Units.
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)
Copy file name to clipboardExpand all lines: articles/synapse-analytics/synapse-link/concept-synapse-link-cosmos-db-support.md
+6-7Lines changed: 6 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,27 +13,25 @@ ms.reviewer: jrasnick
13
13
14
14
# Azure Synapse Link for Azure Cosmos DB supported features
15
15
16
-
This article describes what functionalities are currently supported in Azure Synapse Link for Azure Cosmos DB.
16
+
This article describes the functionalities that are currently supported in Azure Synapse Link for Azure Cosmos DB.
17
17
18
18
## Azure Synapse support
19
19
20
20
There are two types of containers in Azure Cosmos DB:
21
21
* HTAP container - A container with Synapse Link enabled. This container has both transactional store and analytical store.
22
22
* OLTP container - A container with only transaction store; Synapse Link is not enabled.
23
23
24
-
You can connect to Cosmos DB container without enabling Synapse Link, in which case you can only read/write to the transactional store.
25
-
26
-
Here is list of the currently supported features within Synapse Link for Cosmos DB.
24
+
You can connect to an Azure Cosmos DB container without enabling Synapse Link, in which case you can only read/write to the transactional store. What follows a is list of the currently supported features within Synapse Link for Azure Cosmos DB.
|**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
29
|**Cosmos DB API support**|API support as a Synapse Link| SQL / Mongo DB | SQL / Mongo DB |
32
-
|**Object**|Objects such as table that can be created, pointing directly to Azure Cosmos DB container| View, Table | View |
30
+
|**Object**|Objects such as a table that can be created, pointing directly to Azure Cosmos DB container| View, Table | View |
33
31
|**Read**|Read data from an Azure Cosmos DB container| OLTP / HTAP | HTAP |
34
32
|**Write**|Write data from run-time into an Azure Cosmos DB container| OLTP | n/a |
35
33
36
-
* If you write data into an Azure Cosmos DB container from Spark happens through the transactional store of Azure Cosmos DB and will impact the transactional performance of Azure Cosmos DB by consuming Request Units.
34
+
* If you write data into an Azure Cosmos DB container from Spark, this process happens through the transactional store of Azure Cosmos DB and will impact the transactional performance of Azure Cosmos DB by consuming Request Units.
37
35
* SQL pool integration through external tables is currently not supported.
38
36
39
37
## Supported code-generated actions for Spark
@@ -57,4 +55,5 @@ Here is list of the currently supported features within Synapse Link for Cosmos
57
55
58
56
## Next steps
59
57
60
-
See how to [connect to Synapse Link for Azure Cosmos DB](./how-to-connect-synapse-link-cosmos-db.md)
58
+
* See how to [connect to Synapse Link for Azure Cosmos DB](../quickstart-connect-synapse-link-cosmos-db.md)
59
+
*[Learn how to query the analytical store with Spark](how-to-query-analytical-store-spark.md)
Copy file name to clipboardExpand all lines: articles/synapse-analytics/synapse-link/how-to-connect-synapse-link-cosmos-db.md
+10-6Lines changed: 10 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ This article describes how to access an Azure Cosmos DB database from Azure Syna
17
17
18
18
## Prerequisites
19
19
20
-
Before you connect an Azure Cosmos DB account to your workspace, there are a few things that you need.
20
+
Before you connect an Azure Cosmos DB account to your workspace, you'll need the following:
21
21
22
22
* Existing Azure Cosmos DB account or create a new account following this [quickstart](https://docs.microsoft.com/azure/cosmos-db/how-to-manage-database-account)
23
23
* Existing Synapse workspace or create a new workspace following this [quickstart](https://docs.microsoft.com/azure/synapse-analytics/quickstart-create-workspace)
@@ -26,21 +26,25 @@ Before you connect an Azure Cosmos DB account to your workspace, there are a few
26
26
27
27
To run large-scale analytics into Azure Cosmos DB without impacting your operational performance, we recommend enabling Synapse Link for Azure Cosmos DB. Synapse Link brings HTAP capability to a container and built-in support in Azure Synapse.
28
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**.
32
+
29
33
## Connect an Azure Cosmos DB database to a Synapse workspace
30
34
31
-
Connecting an Azure Cosmos DB database is done as linked service. A Cosmos DB linked service enables users to browse and explore data, read, and write from Synapse Spark or SQL into Azure Cosmos DB.
35
+
Connecting an Azure Cosmos DB database is done as a linked service. A Cosmos DB linked service enables users to browse and explore data, read, and write from Synapse Spark or SQL into Azure Cosmos DB.
32
36
33
-
From the Data Object Explorer, you can directly connect an Azure Cosmos DB database by doing the following steps:
37
+
From the Data Object Explorer, you can directly connect to an Azure Cosmos DB database by doing the following steps:
34
38
1. Select ***+*** icon near Data
35
39
2. Select **Connect to external data**
36
-
3. Select the API that you want to connect to: SQL or MongoDB
40
+
3. Select the API that you want to connect to: SQL API or MongoDB API
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
-
Azure Cosmos DB database are visible under the tab **Linked** in the Azure Cosmos DB section. With Azure Cosmos DB, you can differentiate an HTAP enabled container from an OLTP only container through the following icons:
47
+
Azure Cosmos DB databases are visible under the tab **Linked** in the Azure Cosmos DB section. With Azure Cosmos DB, you can differentiate an HTAP enabled container from an OLTP only container through the following icons:
Copy file name to clipboardExpand all lines: articles/synapse-analytics/synapse-link/how-to-query-analytical-store-spark.md
+13-10Lines changed: 13 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,11 +13,13 @@ ms.reviewer: jrasnick
13
13
14
14
# Query Azure Cosmos DB Analytical Store with Synapse Spark
15
15
16
-
This article gives some examples on how you can interact with the Analytical Store from Synapse gestures. Those gestures are visible when you right-click on a container. With gestures, you can quickly generate code and tweak it to your needs. They are also perfect for discovering data with a single click.
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. Gestures are also perfect for discovering data with a single click.
17
17
18
18
## Load to DataFrame
19
19
20
-
In this step, you will read data from Azure Cosmos DB Analytical Store in a Spark DataFrame. It will display 10 rows from the DataFrame called ***df***. Once your data is in a dataframe, you can perform additional analysis. This operation does not impact the transactional store.
20
+
In this step, you'll read data from Azure Cosmos DB analytical store in a Spark DataFrame. It will display 10 rows from the DataFrame called ***df***. Once your data is into dataframe, you can perform additional analysis.
21
+
22
+
This operation doesn't impact the transactional store.
21
23
22
24
```python
23
25
# To select a preferred list of regions in a multi-region Cosmos DB account, add .option("spark.cosmos.preferredRegions", "<Region1>,<Region2>")
@@ -42,7 +44,9 @@ val df_olap = spark.read.format("cosmos.olap").
42
44
43
45
## Create Spark table
44
46
45
-
In this gesture, you will create a Spark table pointing to the container you selected. This operation does not incur any data movement. If you decide to delete the table, the underlying container (and corresponding Analytical Store) won't be impacted. This scenario is convenient to reuse tables through third-party tools and provide accessibility to the data at run-time.
47
+
In this gesture, you'll create a Spark table pointing to the container you selected. That operation doesn't incur any data movement. If you decide to delete that table, the underlying container (and corresponding analytical store) won't be affected.
48
+
49
+
This scenario is convenient to reuse tables through third-party tools and provide accessibility to the data for the run-time.
In this gesture, you will write a dataframe into a container. This operation will impact the transactional performance and consume Request Units. Using Azure Cosmos DB transactional performance is ideal for write transactions. Make sure that you replace **YOURDATAFRAME** by the dataframe that you want to write back to.
63
+
In this gesture, you'll write a dataframe into a container. This operation will impact the transactional performance and consume Request Units. Using Azure Cosmos DB transactional performance is ideal for write transactions. Make sure that you replace **YOURDATAFRAME** by the dataframe that you want to write back to.
60
64
61
65
```python
62
66
# Write a Spark DataFrame into a Cosmos DB container
@@ -86,8 +90,9 @@ df.write.format("cosmos.oltp").
86
90
```
87
91
88
92
## Load streaming DataFrame from container
93
+
In this gesture, you'll use Spark Streaming capability to load data from a container into a dataframe. The data will be stored in the primary data lake account (and file system) that you connected to the workspace.
89
94
90
-
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. If the folder /localReadCheckpointFolder does not exist, it will be automatically created. This operation will impact the transactional performance of Cosmos DB.
95
+
If the folder */localReadCheckpointFolder* isn't created, it will be automatically created. This operation will impact the transactional performance of Cosmos DB.
91
96
92
97
```python
93
98
# To select a preferred list of regions in a multi-region Cosmos DB account, add .option("spark.cosmos.preferredRegions", "<Region1>,<Region2>")
@@ -119,8 +124,7 @@ val dfStream = spark.readStream.
119
124
```
120
125
121
126
## Write streaming DataFrame to container
122
-
123
-
In this gesture, you will write a streaming dataframe into the Cosmos DB container you selected. If the folder /localReadCheckpointFolder does not exist, it will be automatically created. This operation will impact the transactional performance of Cosmos DB.
127
+
In this gesture, you'll write a streaming dataframe into the Cosmos DB container you selected. If the folder */localReadCheckpointFolder* isn't created, it will be automatically created. This operation will impact the transactional performance of Cosmos DB.
124
128
125
129
```python
126
130
# To select a preferred list of regions in a multi-region Cosmos DB account, add .option("spark.cosmos.preferredRegions", "<Region1>,<Region2>")
0 commit comments