I am trying to create an external table in synapse analytics, but I am facing error while creating the external data source.
Below is the code:
CREATE MASTER KEY ENCRYPTION BY PASSWORD='xxxxxxxxxxxx'; -- executed
CREATE DATABASE SCOPED CREDENTIAL storageCred WITH -- executed
IDENTITY = 'SHARED ACCESS SIGNATURE',
SECRET = 'xxxxxxxxxxxxxx';
CREATE EXTERNAL DATA SOURCE adls WITH -- execution failed
( TYPE = HADOOP,
LOCATION = 'abfss://staging@devedw2021.dfs.core.windows.net',
CREDENTIAL = storageCred
)
The syntax looks right for the External Data Source, but the problem may be with the Database Scoped Credential. I spent a LOT of time on this, and the only way I could get this to work was with Account name and key:
CREATE DATABASE SCOPED CREDENTIAL CausewayAdlsCredentials
WITH
IDENTITY = '<storage_account_name>' ,
SECRET = '<storage_account_key>'
;
One word of warning: beware the documentation. There are several different locations that discuss this problem, and they have conflicting messaging or refer to old versions. This one is OK, but only section C worked for me.