Skip to content

Commit fb237e6

Browse files
Update tutorial-connect-power-bi-desktop.md
1 parent 8a2267d commit fb237e6

File tree

1 file changed

+11
-20
lines changed

1 file changed

+11
-20
lines changed

articles/synapse-analytics/sql/tutorial-connect-power-bi-desktop.md

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: azaricstefan
66
ms.service: synapse-analytics
77
ms.topic: tutorial
88
ms.subservice:
9-
ms.date: 04/15/2020
9+
ms.date: 05/20/2020
1010
ms.author: v-stazar
1111
ms.reviewer: jrasnick, carlrab
1212
---
@@ -46,34 +46,24 @@ Create the demo database (and drop an existing database if necessary) by running
4646

4747
```sql
4848
-- Drop database if it exists
49-
IF EXISTS (SELECT * FROM sys.databases WHERE name = 'Demo')
50-
BEGIN
51-
DROP DATABASE Demo
52-
END;
49+
DROP DATABASE IF EXISTS Demo
5350
GO
5451

5552
-- Create new database
5653
CREATE DATABASE [Demo];
5754
GO
5855
```
5956

60-
## 2 - Create credential
57+
## 2 - Create data source
6158

62-
A credential is necessary for the SQL on-demand service to access files in storage. Create the credential for a storage account that is located in the same region as your endpoint. Although SQL on-demand can access storage accounts from different regions, having the storage and endpoint in the same region provides better performance.
59+
A data source is necessary for the SQL on-demand service to access files in storage. Create the data source for a storage account that is located in the same region as your endpoint. Although SQL on-demand can access storage accounts from different regions, having the storage and endpoint in the same region provides better performance.
6360

64-
Create the credential by running the following Transact-SQL (T-SQL) script:
61+
Create the data source by running the following Transact-SQL (T-SQL) script:
6562

6663
```sql
67-
IF EXISTS (SELECT * FROM sys.credentials WHERE name = 'https://azureopendatastorage.blob.core.windows.net/censusdatacontainer')
68-
DROP CREDENTIAL [https://azureopendatastorage.blob.core.windows.net/censusdatacontainer];
69-
GO
70-
71-
-- Create credentials for Census Data container which resides in a azure open data storage account
72-
-- There is no secret. We are using public storage account which doesn't need a secret.
73-
CREATE CREDENTIAL [https://azureopendatastorage.blob.core.windows.net/censusdatacontainer]
74-
WITH IDENTITY='SHARED ACCESS SIGNATURE',
75-
SECRET = '';
76-
GO
64+
-- There is no credential in data surce. We are using public storage account which doesn't need a secret.
65+
CREATE EXTERNAL DATA SOURCE AzureOpenData
66+
WITH ( LOCATION = 'https://azureopendatastorage.blob.core.windows.net/')
7767
```
7868

7969
## 3 - Prepare view
@@ -91,7 +81,8 @@ SELECT
9181
*
9282
FROM
9383
OPENROWSET(
94-
BULK 'https://azureopendatastorage.blob.core.windows.net/censusdatacontainer/release/us_population_county/year=20*/*.parquet',
84+
BULK 'censusdatacontainer/release/us_population_county/year=20*/*.parquet',
85+
DATA_SOURCE = 'AzureOpenData',
9586
FORMAT='PARQUET'
9687
) AS uspv;
9788
```
@@ -158,7 +149,7 @@ Once you're done using this report, delete the resources with the following step
158149
1. Delete the credential for the storage account
159150

160151
```sql
161-
DROP CREDENTIAL [https://azureopendatastorage.blob.core.windows.net/censusdatacontainer];
152+
DROP EXTENAL DATA SOURCE AzureOpenData
162153
```
163154

164155
2. Delete the view

0 commit comments

Comments
 (0)