Skip to content

Commit da99892

Browse files
authored
Applied a few changes in the credential section
This document described two types of credentials: server-level credential and database scoped credential. There are a few issues in the current version of the document: 1. It omits 'server-level' somewhere it shouldn't, which caused confusion. 2. It only provides instructions about how to grant permission to create and use server-level credential, but not for database scoped credential. 3. It calls 'server-level credential' somewhere, but calls it 'server-scoped credential' somewhere else, which caused confusion.
1 parent b7f6ac0 commit da99892

File tree

1 file changed

+24
-10
lines changed

1 file changed

+24
-10
lines changed

articles/synapse-analytics/sql/develop-storage-files-storage-access-control.md

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -236,25 +236,39 @@ To query a file located in Azure Storage, your serverless SQL pool end point nee
236236
- Server-level CREDENTIAL is used for ad-hoc queries executed using `OPENROWSET` function. Credential name must match the storage URL.
237237
- DATABASE SCOPED CREDENTIAL is used for external tables. External table references `DATA SOURCE` with the credential that should be used to access storage.
238238
239-
To allow a user to create or drop a credential, admin can GRANT/DENY ALTER ANY CREDENTIAL permission to a user:
239+
To allow a user to create or drop a server-level credential, admin can GRANT ALTER ANY CREDENTIAL permission to the user:
240240
241241
```sql
242242
GRANT ALTER ANY CREDENTIAL TO [user_name];
243243
```
244+
To allow a user to create or drop a database scoped credential, admin can GRANT CONTROL permission on the database to the user:
245+
246+
```sql
247+
GRANT CONTROL ON DATABASE::[database_name] TO [user_name];
248+
```
249+
244250

245251
Database users who access external storage must have permission to use credentials.
246252

247253
### Grant permissions to use credential
248254

249-
To use the credential, a user must have `REFERENCES` permission on a specific credential. To grant a `REFERENCES` permission ON a storage_credential for a specific_user, execute:
255+
To use the credential, a user must have `REFERENCES` permission on a specific credential.
256+
257+
To grant a `REFERENCES` permission ON a server-level credential for a specific_user, execute:
250258

251259
```sql
252-
GRANT REFERENCES ON CREDENTIAL::[storage_credential] TO [specific_user];
260+
GRANT REFERENCES ON CREDENTIAL::[server-level_credential] TO [specific_user];
253261
```
254262

255-
## Server-scoped credential
263+
To grant a `REFERENCES` permission ON a DATABASE SCOPED CREDENTIAL for a specific_user, execute:
256264

257-
Server-scoped credentials are used when SQL login calls `OPENROWSET` function without `DATA_SOURCE` to read files on some storage account. The name of server-scoped credential **must** match the base URL of Azure storage (optionally followed by a container name). A credential is added by running [CREATE CREDENTIAL](/sql/t-sql/statements/create-credential-transact-sql?view=azure-sqldw-latest&preserve-view=true). You'll need to provide a CREDENTIAL NAME argument.
265+
```sql
266+
GRANT REFERENCES ON DATABASE SCOPED CREDENTIAL::[database-scoped_credential] TO [specific_user];
267+
```
268+
269+
## Server-level credential
270+
271+
Server-level credentials are used when SQL login calls `OPENROWSET` function without `DATA_SOURCE` to read files on some storage account. The name of server-level credential **must** match the base URL of Azure storage (optionally followed by a container name). A credential is added by running [CREATE CREDENTIAL](/sql/t-sql/statements/create-credential-transact-sql?view=azure-sqldw-latest&preserve-view=true). You'll need to provide a CREDENTIAL NAME argument.
258272

259273
> [!NOTE]
260274
> The `FOR CRYPTOGRAPHIC PROVIDER` argument is not supported.
@@ -267,7 +281,7 @@ Server-level CREDENTIAL name must match the full path to the storage account (an
267281
| Azure Data Lake Storage Gen1 | https | <storage_account>.azuredatalakestore.net/webhdfs/v1 |
268282
| Azure Data Lake Storage Gen2 | https | <storage_account>.dfs.core.windows.net |
269283

270-
Server-scoped credentials enable access to Azure storage using the following authentication types:
284+
Server-level credentials enable access to Azure storage using the following authentication types:
271285

272286
### [User Identity](#tab/user-identity)
273287

@@ -314,7 +328,7 @@ Optionally, you can use just the base URL of the storage account, without contai
314328

315329
### [Public access](#tab/public-access)
316330

317-
Database scoped credential isn't required to allow access to publicly available files. Create [data source without database scoped credential](develop-tables-external-tables.md?tabs=sql-ondemand#example-for-create-external-data-source) to access publicly available files on Azure storage.
331+
Server-level credential isn't required to allow access to publicly available files. Create [data source without credential](develop-tables-external-tables.md?tabs=sql-ondemand#example-for-create-external-data-source) to access publicly available files on Azure storage.
318332

319333
---
320334

@@ -392,7 +406,7 @@ The database scoped credential doesn't need to match the name of storage account
392406

393407
### [Public access](#tab/public-access)
394408

395-
Database scoped credential isn't required to allow access to publicly available files. Create [data source without database scoped credential](develop-tables-external-tables.md?tabs=sql-ondemand#example-for-create-external-data-source) to access publicly available files on Azure storage.
409+
Database scoped credential isn't required to allow access to publicly available files. Create [data source without credential](develop-tables-external-tables.md?tabs=sql-ondemand#example-for-create-external-data-source) to access publicly available files on Azure storage.
396410

397411
```sql
398412
CREATE EXTERNAL DATA SOURCE mysample
@@ -421,7 +435,7 @@ CREATE EXTERNAL FILE FORMAT [SynapseParquetFormat]
421435
WITH ( FORMAT_TYPE = PARQUET)
422436
GO
423437
CREATE EXTERNAL DATA SOURCE publicData
424-
WITH ( LOCATION = 'https://<storage_account>.dfs.core.windows.net/<public_container>/<path>' )
438+
WITH ( LOCATION = 'https://<storage_account>.dfs.core.windows.net/<public_container>/<path>' )
425439
GO
426440

427441
CREATE EXTERNAL TABLE dbo.userPublicData ( [id] int, [first_name] varchar(8000), [last_name] varchar(8000) )
@@ -468,7 +482,7 @@ CREATE EXTERNAL FILE FORMAT [SynapseParquetFormat] WITH ( FORMAT_TYPE = PARQUET)
468482
GO
469483

470484
CREATE EXTERNAL DATA SOURCE mysample
471-
WITH ( LOCATION = 'https://<storage_account>.dfs.core.windows.net/<container>/<path>'
485+
WITH ( LOCATION = 'https://<storage_account>.dfs.core.windows.net/<container>/<path>'
472486
-- Uncomment one of these options depending on authentication method that you want to use to access data source:
473487
--,CREDENTIAL = WorkspaceIdentity
474488
--,CREDENTIAL = SasCredential

0 commit comments

Comments
 (0)