I have uploaded a single file (BlockBlob) to a container in the Azure BlobStorage
This is the path: https://myStorageName.blob.core.windows.net/myContainerName/myFolder.Name/myFileName.json
I want to load this file into a table within Azure Sql Database
If I create a SAS to the file, things works perfectly. However I am failing to generate a single SAS that can access multiple files inside a container.
Here is the code that works:
CREATE DATABASE SCOPED CREDENTIAL TemporaryBlobSCredential
WITH IDENTITY = 'SHARED ACCESS SIGNATURE',
SECRET = 'sp=......................'
CREATE EXTERNAL DATA SOURCE TemporaryBlobDataSource
WITH ( TYPE = BLOB_STORAGE,
LOCATION = 'https://<myStorageName>.blob.core.windows.net/<myContainerName>',
CREDENTIAL= TemporaryBlobSCredential);
create table <tableName>
(JsonData varchar(max))
BULK INSERT <tableName>
FROM '<myFolder.Name>/<myFileName>.json'
WITH (DATA_SOURCE = 'TemporaryBlobDataSource');
If I generate a SAS that has ALL the permissions (SECRET = '?sv=......') it won't work:
Should I use something different? Does it even works?
