bulk insert into azure sql from blob with sas says blob does not exist or don't have file access rights.

Tyler Furman 0 Reputation points
2025-06-18T22:09:21.8766667+00:00

Can't bulk insert into azure sql from blob with sas says blob does not exist or don't have file access rights.

I have created a container, in my azure sql db I have made a scoped credential with the secret from the container. I have then made an external data source using that credential with the container name. I have loaded a csv into my container, obtained a sas key for the csv file and then tried to bulk insert with the full path including container, file, and sas, but it keeps giving me the error "Cannot bulk load. The file "https://nicedbcloud.blob.core.windows.net/nice-db/values.csv?<sas token>" does not exist or you don't have file access rights" which makes no sense as I have given it all the necessary ability to work. Additionally, when I take that file url and paste it into a browser it lets me access the file without problem, so why can't I use it in this bulk insert sql?

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
3,192 questions
{count} votes

1 answer

Sort by: Most helpful
  1. KapilAnanth-MSFT 49,536 Reputation points Microsoft Employee Moderator
    2025-06-23T11:35:37.8933333+00:00

    @Tyler Furman ,

    Customer's update: I was using the wrong name in the FROM section of the bulk insert statement.

    Other Troubleshooting steps:

    When you say "when I take that file url and paste it into a browser it lets me access the file without problem"

    • This indicates the issue could be from the source side
    • i.e., Azure SQL Server and not the Storage Account.

    I suggest you make sure the steps involved are correct according to

    1. Access data in a CSV file referencing a container in an Azure Blob Storage location
    2. Cannot bulk load. The file "xyz" does not exist or you don't have file access

    Once done, make sure the user has enough permissions on the SQL Server itself.

    If the above does not help too,

    • Please share the exact SQL Code you are using to perform this operation
    • Please share the screenshot of the SAS Token permissions (from Portal)
    • Of course please feel free to blur/hide any PII or sensitive data

    Cheers,

    Kapil

    0 comments No comments

Your answer

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