SQL Server - Access denied when reading a file from Azure Blob Storage container using SAS key

Dustine Todd 1 Reputation point
2022-10-03T22:43:00.937+00:00

I have a requirement to read CSV files from an Azure blob storage. So far, this is throwing access denied errors every time I run my query:

CREATE DATABASE SCOPED CREDENTIAL 
Azure SQL Database
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,639 questions
{count} votes

2 answers

Sort by: Most helpful
  1. ShaktiSingh-MSFT 14,481 Reputation points Microsoft Employee
    2023-03-10T06:22:59.0033333+00:00

    Hi @Irfan basha Shaik,

    Welcome to Microsoft Q&A forum.

    If you are facing similar issue, please follow the steps on SQL server below if helps:

    1. open SQL Server
    2. right click on database
    3. select properties.
    4. select permissions.
    5. select your database role (local or cloud)
    6. At bottom you will see explicit permissions table
    7. find " backup database " permission and click Grant permission.

    Other helpful links: https://sqlbak.com/blog/cannot-bulk-load-because-the-file-could-not-be-opened-operating-system-error-code-5-access-is-denied

    https://techcommunity.microsoft.com/t5/sql-server-support-blog/sql-bulk-copy-error-8220-operating-system-error-code-5-access-is/ba-p/316231

    Let us know if this helped or still have issue. Thanks


  2. Lara, Yasmani 0 Reputation points
    2023-03-31T19:11:03.8566667+00:00

    Hi there, I'm also facing the same issue. Has someone found a solution?