Skip to content

Commit df848ce

Browse files
Merge pull request #295736 from jovanpop-msft/patch-668324
Managed identity for cosmosdb
2 parents d26b2b0 + c9975d4 commit df848ce

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

articles/synapse-analytics/sql/query-cosmos-db-analytical-store.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ For querying Azure Cosmos DB, the full [SELECT](/sql/t-sql/queries/select-transa
1919

2020
This article explains how to write a query with a serverless SQL pool that queries data from Azure Cosmos DB containers that are enabled with Azure Synapse Link. You can then learn more about building serverless SQL pool views over Azure Cosmos DB containers and connecting them to Power BI models in [this tutorial](./tutorial-data-analyst.md). This tutorial uses a container with an [Azure Cosmos DB well-defined schema](/azure/cosmos-db/analytical-store-introduction#schema-representation). You can also check out the Learn module on how to [Query Azure Cosmos DB with SQL Serverless for Azure Synapse Analytics](/training/modules/query-azure-cosmos-db-with-sql-serverless-for-azure-synapse-analytics/).
2121

22-
>[!NOTE]
23-
> You can't use managed identity to access an Azure Cosmos DB container from serverless SQL pool.
24-
2522
## Prerequisites
2623

2724
- Make sure that you prepare the analytical store:
@@ -37,10 +34,11 @@ This article explains how to write a query with a serverless SQL pool that queri
3734
## Overview
3835

3936
Serverless SQL pool enables you to query Azure Cosmos DB analytical storage using `OPENROWSET` function.
37+
- `OPENROWSET` that uses workspace managed identity to access the analytical store.
4038
- `OPENROWSET` with inline key. This syntax can be used to query Azure Cosmos DB collections without the need to prepare credentials.
4139
- `OPENROWSET` that references a credential that contains the Azure Cosmos DB account key. This syntax can be used to create views on Azure Cosmos DB collections.
4240

43-
### [OPENROWSET with key](#tab/openrowset-key)
41+
### [OPENROWSET with key or managed identity](#tab/openrowset-key)
4442

4543
To support querying and analyzing data in an Azure Cosmos DB analytical store, a serverless SQL pool is used. The serverless SQL pool uses the `OPENROWSET` SQL syntax, so you must first convert your Azure Cosmos DB connection string to this format:
4644

@@ -67,6 +65,11 @@ The SQL connection string has the following format:
6765
```
6866

6967
The region is optional. If omitted, the container's primary region is used.
68+
You can use workspace managed identity instead fo the CosmosDB account key:
69+
70+
```sql
71+
'account=<databases account name>;database=<database_name>;authtype=ManagedIdentity'
72+
```
7073

7174
> [!IMPORTANT]
7275
> There's another optional parameter in connection string called `endpoint`. The `endpoint` param is needed for accounts that don't match the standard `*.documents.azure.com` format. For example, if your Azure Cosmos DB account ends with `.documents.azure.us`, make sure that you add `endpoint=<account name>.documents.azure.us` in the connection string.

0 commit comments

Comments
 (0)