You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Copy file name to clipboardExpand all lines: articles/synapse-analytics/sql/develop-storage-files-storage-access-control.md
+24-10Lines changed: 24 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -236,25 +236,39 @@ To query a file located in Azure Storage, your serverless SQL pool end point nee
236
236
- Server-level CREDENTIAL is used for ad-hoc queries executed using `OPENROWSET` function. Credential name must match the storage URL.
237
237
- DATABASE SCOPED CREDENTIAL is used for external tables. External table references `DATA SOURCE` with the credential that should be used to access storage.
238
238
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:
240
240
241
241
```sql
242
242
GRANT ALTER ANY CREDENTIAL TO [user_name];
243
243
```
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
+
244
250
245
251
Database users who access external storage must have permission to use credentials.
246
252
247
253
### Grant permissions to use credential
248
254
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:
250
258
251
259
```sql
252
-
GRANTREFERENCESON CREDENTIAL::[storage_credential] TO [specific_user];
260
+
GRANTREFERENCESON CREDENTIAL::[server-level_credential] TO [specific_user];
253
261
```
254
262
255
-
## Server-scoped credential
263
+
To grant a `REFERENCES` permission ON a DATABASE SCOPED CREDENTIAL for a specific_user, execute:
256
264
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
+
GRANTREFERENCESON 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.
258
272
259
273
> [!NOTE]
260
274
> 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
267
281
| Azure Data Lake Storage Gen1 | https | <storage_account>.azuredatalakestore.net/webhdfs/v1 |
268
282
| Azure Data Lake Storage Gen2 | https | <storage_account>.dfs.core.windows.net |
269
283
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:
271
285
272
286
### [User Identity](#tab/user-identity)
273
287
@@ -314,7 +328,7 @@ Optionally, you can use just the base URL of the storage account, without contai
314
328
315
329
### [Public access](#tab/public-access)
316
330
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.
318
332
319
333
---
320
334
@@ -392,7 +406,7 @@ The database scoped credential doesn't need to match the name of storage account
392
406
393
407
### [Public access](#tab/public-access)
394
408
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.
396
410
397
411
```sql
398
412
CREATE EXTERNAL DATA SOURCE mysample
@@ -421,7 +435,7 @@ CREATE EXTERNAL FILE FORMAT [SynapseParquetFormat]
421
435
WITH ( FORMAT_TYPE = PARQUET)
422
436
GO
423
437
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>' )
0 commit comments