Skip to content

Commit bfaba4d

Browse files
committed
Removing references to old cosmosdb account
1 parent 759b8bb commit bfaba4d

File tree

3 files changed

+27
-19
lines changed

3 files changed

+27
-19
lines changed

articles/synapse-analytics/sql/create-use-views.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,15 +151,22 @@ The `OPENJSON` function parses each line from the JSONL file containing one JSON
151151

152152
The views can be created on top of the Azure Cosmos DB containers if the Azure Cosmos DB analytical storage is enabled on the container. The Azure Cosmos DB account name, database name, and container name should be added as a part of the view, and the read-only access key should be placed in the database scoped credential that the view references.
153153

154+
This example script uses a database and container you can set up by [following these instructions](query-cosmos-db-analytical-store.md#sample-dataset).
155+
156+
>[IMPORTANT]
157+
>In the script, replace these values with your own values:
158+
>- **your-cosmosdb** - the name of your Cosmos DB account
159+
>- **access-key** - your Cosmos DB account key
160+
154161
```sql
155162
CREATE DATABASE SCOPED CREDENTIAL MyCosmosDbAccountCredential
156-
WITH IDENTITY = 'SHARED ACCESS SIGNATURE', SECRET = 's5zarR2pT0JWH9k8roipnWxUYBegOuFGjJpSjGlR36y86cW0GQ6RaaG8kGjsRAQoWMw1QKTkkX8HQtFpJjC8Hg==';
163+
WITH IDENTITY = 'SHARED ACCESS SIGNATURE', SECRET = 'access-key';
157164
GO
158165
CREATE OR ALTER VIEW Ecdc
159166
AS SELECT *
160167
FROM OPENROWSET(
161168
PROVIDER = 'CosmosDB',
162-
CONNECTION = 'Account=synapselink-cosmosdb-sqlsample;Database=covid',
169+
CONNECTION = 'Account=<your-cosmosdb>;Database=covid',
163170
OBJECT = 'Ecdc',
164171
CREDENTIAL = 'MyCosmosDbAccountCredential'
165172
) with ( date_rep varchar(20), cases bigint, geo_id varchar(6) ) as rows

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

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,6 @@ To follow along with this article showcasing how to query Azure Cosmos DB data w
117117
* An Azure Cosmos DB database named `covid`
118118
* Two Azure Cosmos DB containers named `Ecdc` and `Cord19` loaded with the preceding sample datasets
119119

120-
You can use the following connection string for testing purpose:
121-
122-
`Account=synapselink-cosmosdb-sqlsample;Database=covid;Key=s5zarR2pT0JWH9k8roipnWxUYBegOuFGjJpSjGlR36y86cW0GQ6RaaG8kGjsRAQoWMw1QKTkkX8HQtFpJjC8Hg==`
123-
124120
Note that this connection doesn't guarantee performance because this account might be located in remote region compared to your Synapse SQL endpoint.
125121

126122
## Explore Azure Cosmos DB data with automatic schema inference
@@ -129,11 +125,16 @@ The easiest way to explore data in Azure Cosmos DB is by using the automatic sch
129125

130126
### [OPENROWSET with key](#tab/openrowset-key)
131127

128+
>[IMPORTANT]
129+
>In the script, replace these values with your own values:
130+
>- **your-cosmosdb** - the name of your Cosmos DB account
131+
>- **yourcosmosdbkey** - your Cosmos DB account key
132+
132133
```sql
133134
SELECT TOP 10 *
134135
FROM OPENROWSET(
135136
'CosmosDB',
136-
'Account=synapselink-cosmosdb-sqlsample;Database=covid;Key=s5zarR2pT0JWH9k8roipnWxUYBegOuFGjJpSjGlR36y86cW0GQ6RaaG8kGjsRAQoWMw1QKTkkX8HQtFpJjC8Hg==',
137+
'Account=your-cosmosdb;Database=covid;Key=yourcosmosdbkey',
137138
Ecdc) as documents
138139
```
139140

@@ -142,12 +143,12 @@ FROM OPENROWSET(
142143
```sql
143144
/* Setup - create server-level or database scoped credential with Azure Cosmos DB account key:
144145
CREATE CREDENTIAL MyCosmosDbAccountCredential
145-
WITH IDENTITY = 'SHARED ACCESS SIGNATURE', SECRET = 's5zarR2pT0JWH9k8roipnWxUYBegOuFGjJpSjGlR36y86cW0GQ6RaaG8kGjsRAQoWMw1QKTkkX8HQtFpJjC8Hg==';
146+
WITH IDENTITY = 'SHARED ACCESS SIGNATURE', SECRET = 'yourcosmosdbkey';
146147
*/
147148
SELECT TOP 10 *
148149
FROM OPENROWSET(
149150
PROVIDER = 'CosmosDB',
150-
CONNECTION = 'Account=synapselink-cosmosdb-sqlsample;Database=covid',
151+
CONNECTION = 'Account=your-cosmosdb;Database=covid',
151152
OBJECT = 'Ecdc',
152153
SERVER_CREDENTIAL = 'MyCosmosDbAccountCredential'
153154
) with ( date_rep varchar(20), cases bigint, geo_id varchar(6) ) as rows
@@ -171,7 +172,7 @@ If you need to explore data from the other container in the same Azure Cosmos DB
171172
SELECT TOP 10 *
172173
FROM OPENROWSET(
173174
'CosmosDB',
174-
'Account=synapselink-cosmosdb-sqlsample;Database=covid;Key=s5zarR2pT0JWH9k8roipnWxUYBegOuFGjJpSjGlR36y86cW0GQ6RaaG8kGjsRAQoWMw1QKTkkX8HQtFpJjC8Hg==',
175+
'Account=your-cosmosdb;Database=covid;Key=yourcosmosdbkey',
175176
Cord19) as cord19
176177
```
177178

@@ -197,7 +198,7 @@ These flat JSON documents in Azure Cosmos DB can be represented as a set of rows
197198
SELECT TOP 10 *
198199
FROM OPENROWSET(
199200
'CosmosDB',
200-
'Account=synapselink-cosmosdb-sqlsample;Database=covid;Key=s5zarR2pT0JWH9k8roipnWxUYBegOuFGjJpSjGlR36y86cW0GQ6RaaG8kGjsRAQoWMw1QKTkkX8HQtFpJjC8Hg==',
201+
'Account=your-cosmosdb;Database=covid;Key=yourcosmosdbkey',
201202
Ecdc
202203
) with ( date_rep varchar(20), cases bigint, geo_id varchar(6) ) as rows
203204
```
@@ -207,12 +208,12 @@ FROM OPENROWSET(
207208
```sql
208209
/* Setup - create server-level or database scoped credential with Azure Cosmos DB account key:
209210
CREATE CREDENTIAL MyCosmosDbAccountCredential
210-
WITH IDENTITY = 'SHARED ACCESS SIGNATURE', SECRET = 's5zarR2pT0JWH9k8roipnWxUYBegOuFGjJpSjGlR36y86cW0GQ6RaaG8kGjsRAQoWMw1QKTkkX8HQtFpJjC8Hg==';
211+
WITH IDENTITY = 'SHARED ACCESS SIGNATURE', SECRET = 'yourcosmosdbkey';
211212
*/
212213
SELECT TOP 10 *
213214
FROM OPENROWSET(
214215
PROVIDER = 'CosmosDB',
215-
CONNECTION = 'Account=synapselink-cosmosdb-sqlsample;Database=covid',
216+
CONNECTION = 'Account=your-cosmosdb;Database=covid',
216217
OBJECT = 'Ecdc',
217218
SERVER_CREDENTIAL = 'MyCosmosDbAccountCredential'
218219
) with ( date_rep varchar(20), cases bigint, geo_id varchar(6) ) as rows
@@ -238,13 +239,13 @@ Once you identify the schema, you can prepare a view on top of your Azure Cosmos
238239

239240
```sql
240241
CREATE CREDENTIAL MyCosmosDbAccountCredential
241-
WITH IDENTITY = 'SHARED ACCESS SIGNATURE', SECRET = 's5zarR2pT0JWH9k8roipnWxUYBegOuFGjJpSjGlR36y86cW0GQ6RaaG8kGjsRAQoWMw1QKTkkX8HQtFpJjC8Hg==';
242+
WITH IDENTITY = 'SHARED ACCESS SIGNATURE', SECRET = 'yourcosmosdbkey';
242243
GO
243244
CREATE OR ALTER VIEW Ecdc
244245
AS SELECT *
245246
FROM OPENROWSET(
246247
PROVIDER = 'CosmosDB',
247-
CONNECTION = 'Account=synapselink-cosmosdb-sqlsample;Database=covid',
248+
CONNECTION = 'Account=your-cosmosdb;Database=covid',
248249
OBJECT = 'Ecdc',
249250
SERVER_CREDENTIAL = 'MyCosmosDbAccountCredential'
250251
) with ( date_rep varchar(20), cases bigint, geo_id varchar(6) ) as rows
@@ -278,7 +279,7 @@ The nested objects and arrays in Azure Cosmos DB are represented as JSON strings
278279
SELECT TOP 10 *
279280
FROM OPENROWSET(
280281
'CosmosDB',
281-
'Account=synapselink-cosmosdb-sqlsample;Database=covid;Key=s5zarR2pT0JWH9k8roipnWxUYBegOuFGjJpSjGlR36y86cW0GQ6RaaG8kGjsRAQoWMw1QKTkkX8HQtFpJjC8Hg==',
282+
'Account=your-cosmosdb;Database=covid;Key=yourcosmosdbkey',
282283
Cord19)
283284
WITH ( paper_id varchar(8000),
284285
title varchar(1000) '$.metadata.title',
@@ -332,7 +333,7 @@ SELECT
332333
FROM
333334
OPENROWSET(
334335
'CosmosDB',
335-
'Account=synapselink-cosmosdb-sqlsample;Database=covid;Key=s5zarR2pT0JWH9k8roipnWxUYBegOuFGjJpSjGlR36y86cW0GQ6RaaG8kGjsRAQoWMw1QKTkkX8HQtFpJjC8Hg==',
336+
'Account=your-cosmosdb;Database=covid;Key=yourcosmosdbkey',
336337
Cord19
337338
) WITH ( title varchar(1000) '$.metadata.title',
338339
authors varchar(max) '$.metadata.authors' ) AS docs

articles/synapse-analytics/sql/tutorial-logical-data-warehouse.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ In order to access Azure Cosmos DB analytical storage, you need to define a cred
7474
```sql
7575
CREATE DATABASE SCOPED CREDENTIAL MyCosmosDbAccountCredential
7676
WITH IDENTITY = 'SHARED ACCESS SIGNATURE',
77-
SECRET = 's5zarR2pT0JWH9k8roipnWxUYBegOuFGjJpSjGlR36y86cW0GQ6RaaG8kGjsRAQoWMw1QKTkkX8HQtFpJjC8Hg==';
77+
SECRET = '<yourcosmosdbaccountkey>';
7878
```
7979

8080
Any user with the Synapse Administrator role can use these credentials to access Azure Data Lake storage or Azure Cosmos DB analytical storage.
@@ -172,7 +172,7 @@ CREATE OR ALTER VIEW ecdc_cosmosdb.Ecdc
172172
AS SELECT *
173173
FROM OPENROWSET(
174174
PROVIDER = 'CosmosDB',
175-
CONNECTION = 'Account=synapselink-cosmosdb-sqlsample;Database=covid',
175+
CONNECTION = 'Account=yourcosmosdbaccount;Database=covid',
176176
OBJECT = 'Ecdc',
177177
CREDENTIAL = 'MyCosmosDbAccountCredential'
178178
) WITH

0 commit comments

Comments
 (0)