Cannot find the CREDENTIAL '<db_scoped_creds>', because it does not exist or you do not have permission

Waqas

I created external tables using the steps specified here: https://docs.microsoft.com/en-us/azure/synapse-analytics/sql/develop-storage-files-storage-access-control?tabs=shared-access-signature.

Within Synapse workspace, I am able to access external table data (as it uses my AD credentials). However, it doesn't work from an external platform, redash in this case. In order to access data from redash, I created a db user and this is where I think I am missing a step to somehow grant this user to access database scope credentials.

Steps, I took to create external table with required creds:

  1. Create database scope credentials to access data inside blob storage
CREATE DATABASE SCOPED CREDENTIAL datalake_credentials
    WITH IDENTITY = 'SHARED ACCESS SIGNATURE',
    SECRET = 'SAS TOKEN';
  1. Create external datasource using credential created in previous step
CREATE EXTERNAL DATA SOURCE datalake_raw_marketing
WITH ( LOCATION = 'https://mydatalake.blob.core.windows.net/raw/marketing'
          , CREDENTIAL= [datalake_credentials]
);
  1. Finally create an external table using datasource
CREATE EXTERNAL TABLE [dbo].[Customers]
(
    [Id] [varchar](36),
    [FirstName] [varchar](100),
    [Email] [varchar](100),
    [Date] [varchar](100),
    [Group] [varchar](100)
)
WITH (DATA_SOURCE = [datalake_raw_marketing], LOCATION = N'sub_dir/customer_list_*.csv',FILE_FORMAT = [QuotedCsvWithHeaderFormat])
GO

Using information on this page https://docs.microsoft.com/en-us/azure/synapse-analytics/sql/develop-storage-files-storage-access-control?tabs=shared-access-signature I tried "Grant permissions to use credential" using:

GRANT REFERENCES ON CREDENTIAL::[datalake_credentials] TO [redash];

But it always results in:

Cannot find the CREDENTIAL 'datalake_credentials', because it does not exist or you do not have permission.

Joel Cochran

Your credential is DATABASE SCOPED, so you need to include that in the statement:

GRANT REFERENCES ON DATABASE SCOPED CREDENTIAL::[{credential_name}] TO [{user}];

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Getting the following error in SQL Server 2012 "Cannot find the user '<user>', because it does not exist or you do not have permission"

Table synchronize error. Cannot drop the index because it does not exist or you do not have permission

SQL Server error: Cannot drop the user because it does not exist or you do not have permission

Update trigger causing SQL error "Cannot find the object "XXX" because it does not exist or you do not have permissions."

pyodbc error schema does not exist or you do not have permission

Cannot find path 'SharePath' because it does not exist

Cannot find path _ because it does not exist

Cannot find path because it does not exist

The specified schema name either does not exist or you do not have permission to use it

netlify deploy failed: git ref refs/heads/master does not exist or you do not have permission

nopCommerce: Database does not exist or you don't have permission to connect to it

Get-ChildItem Cannot Find Path Because It Does Not Exist

GitHub Actions CD "Cannot find path because it does not exist"

SSIS Master package gives The specified schema name either does not exist or you do not have permission to use it error but child package runs

The queue does not exist or you do not have sufficient permissions to perform the operation

Cannot find path because it doesn't exist

@PropertySource cannot be opened because it does not exist

Spring @PropertySource cannot be opened because it does not exist

ssisdb: set_object_parameter_value, Cannot find the parameter because it does not exist

Start-BitsTransfer - "Cannot find path ... because it does not exist" with different credentials to local host

Room + cannot find implementation DB + DB_Impl does not exist

guacamole You do not have permission to access this connection"

You do not have permission to call getContacts

You do not have permission to call setDataValidation

Rubygems: You do not have permission to push to this gem

You do not have permission to extract to this folder

I try to access my desktop thru my PowerShell, and its said "Cannot find path 'C:\Desktop' because it does not exist"

Google Cloud Platform: WARNING: You do not appear to have access to project [project] or it does not exist

"Parameter does not exist or you do not have sufficient permissions" when running SSIS package in C#