Skip to content

Commit ad26522

Browse files
Clarifying cosmosdb parameters
1 parent 7535d75 commit ad26522

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

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

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,31 +50,34 @@ OPENROWSET(
5050
) [ < with clause > ] AS alias
5151
```
5252

53-
The SQL connection string for Azure Cosmos DB specifies the Azure Cosmos DB account name, database name, database account master key, and an optional region name to the `OPENROWSET` function. Some of this information can be taken from the standard Azure Cosmos DB connection string.
53+
The SQL connection string for Azure Cosmos DB includes the following components:
54+
- **Account Name** - The name of the Azure Cosmos DB account you are targeting.
55+
- **Database Name** - The container name, specified without quotation marks in the OPENROWSET syntax. If the container name contains special characters (e.g., a dash -), it should be enclosed in square brackets ([]).
56+
- **Region Name** (optional) - The region of your CosmosDB analytical storage. If omitted, the container's primary region is used.
57+
- **AuthType** - set this option to `ManagedIdentity` if accessing CosmosDB using the Synapse workspace Managed Identity instead of the account key.
58+
- **Key** - The master key for accessing CosmosDB data, used if not utilizing the Synapse workspace managed identity.
59+
- **Endpoint** (optionsl) - required if your CosmosDB account does not follow the standard `*.documents.azure.com` format.
5460

55-
Convert from the standard Azure Cosmos DB connection string format:
61+
Some of this information can be derived from the standard Azure Cosmos DB connection string:
5662

5763
```
5864
AccountEndpoint=https://<database account name>.documents.azure.com:443/;AccountKey=<database account master key>;
5965
```
6066

61-
The SQL connection string has the following format:
62-
67+
The SQL connection string can be formatted as follows:
68+
- Using the CosmosDB database account master key for authentication:
6369
```sql
6470
'account=<database account name>;database=<database name>;region=<region name>;key=<database account master key>'
6571
```
6672

67-
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-
73+
- Using the workspace managed identity instead of the CosmosDB account key:
7074
```sql
7175
'account=<databases account name>;database=<database_name>;authtype=ManagedIdentity'
7276
```
7377

7478
> [!IMPORTANT]
7579
> 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.
7680
77-
The Azure Cosmos DB container name is specified without quotation marks in the `OPENROWSET` syntax. If the container name has any special characters, for example, a dash (-), the name should be wrapped within square brackets (`[]`) in the `OPENROWSET` syntax.
7881

7982
### [OPENROWSET with credential](#tab/openrowset-credential)
8083

0 commit comments

Comments
 (0)