SQL Azure External table using Azue blob storage

Raghunandan Venkateswaran 16 Reputation points
2021-07-16T11:46:45.16+00:00

We are planning to use a Azure blob storage (csv file in a container) as a External data source in our Azure SQL database. We need to Possibly importing data from this CSV to a table , planning to use a Bulk insert.

The Admin user on the database is performing the below operations

  1. creating a database scoped credential
  2. creating a external data source with this credential.

when invoking the bulk insert, it returns that the credentials created cannot be found or does not have access. I am using the admin user on the database. There is no way to grant anything to this user otherwise. what could be wrong?

Azure SQL Database
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Oury Ba-MSFT 21,126 Reputation points Microsoft Employee Moderator
    2021-07-19T23:05:14+00:00

    Hi @Raghunandan Venkateswaran Thank you for posting your question on Microsoft Q&A.
    Looks like you are trying to import data from Azure Blob Storage to Azure SQL Database. To import data from an Azure storage account, you need to create a master key and then create a credential with a key to the Azure storage account. Finally, you create an external data source with that credential. Once created the external data source, you can use the BULK INSERT. You may need to change the access policies to the container. Were you able to successfully create a an external data source that has access to the Azure Storage account. The bulk insert command can directly access a file in Azure Blob Storage.

    116091-image.png

    Create a database scoped credential using the IDENTITY which must be SHARED ACCESS SIGNATURE. Use the SAS token generated for the blob storage account. Verify that your SAS token does not have a leading ?, that you have at least read permission on the object that should be loaded, and that the expiration period is valid (all dates are in UTC time).

    Please share screen shot if possible or any error message

    Regards,
    Oury


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.