Hi All,
I tried connecting to ADLS via polybase and performed below steps:
A) Connecting via Access Key
I have created a database scoped credential with Access key of ADLS as shown below:
create DATABASE SCOPED CREDENTIAL [AEAPADLSStorageCred] WITH IDENTITY = 'dp201',
SECRET = '<Access Key>'
Then created Data Source with the following format:
CREATE EXTERNAL DATA SOURCE [AEAPADLSStorage] WITH
(
TYPE = HADOOP,
LOCATION = 'wasbs://******@adlsname.blob.core.windows.net',
CREDENTIAL = [AEAPADLSStorageCred]
)
After that created External file format and external table and csv file was read successfully.
B) Connecting via Service Principal
I have created a Service Principal and have provided it access on my ADLS
Then created Database scoped credential with following format:
Then created data source with the following format:
CREATE EXTERNAL DATA SOURCE [AEAPADLSStorageSP] WITH
(
TYPE = HADOOP,
LOCATION = 'wasbs://******@adlsname.blob.core.windows.net',
CREDENTIAL = ADL_User
)
But getting the following error when creating external table: unable to connect to blob with provided creds
I tried altering data source with following format:
alter EXTERNAL DATA SOURCE [AEAPADLSStorageSP] set
LOCATION = 'abfss://******@dp201adls.dfs.core.windows.net',
CREDENTIAL = ADL_User
But getting the same error when creating the external table
What is the correct syntax to create database scoped credential and data source to connect to ADLS via Service Principal?