Access to Azure storage container lost - Operating system error code 5 (Access is denied)

Anatoli Titarev 40 Reputation points
2023-09-11T04:55:07.13+00:00

Hello,

I have created a DATABASE SCOPED CREDENTIAL, CREDENTIAL and an EXTERNAL DATA SOURCE on an SQL Server database (not Azure) and was able to access blobs on the storage recently created.

However, I lost access the next day. I have read suggestions how to debug but still couldn't resolve the issue.

For example: https://learn.microsoft.com/en-us/answers/questions/124104/cannot-bulk-load-because-the-file-sqlfiles-csv-cou

I am getting this error:

Cannot bulk load because the file [FILE NAME FOLLOWS] could not be opened.

Operating system error code 5(Access is denied.).

I am not sure if it's a firewall issue. As I said, it worked yesterday. I have rotated the SAS key and recreated credentials and data source.

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

Accepted answer
  1. GeethaThatipatri-MSFT 29,527 Reputation points Microsoft Employee
    2023-09-12T13:11:01.5333333+00:00

    Hi,@Anatoli Titarev I'm glad that you were able to resolve your issue, and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to "Accept " the answer.

    Issue: You have lost access to an Azure storage container and are receiving an "Operating system error code 5 (Access is denied)" message when trying to access a file. you have created a DATABASE SCOPED CREDENTIAL, CREDENTIAL, and an EXTERNAL DATA SOURCE on an SQL Server database (not Azure) and were able to access blobs on the storage recently created.

    Solution: You were able to resolve the issue by identifying that the access had expired quickly and that you had mistakenly added a new token.

    If you have any other questions or are still running into more issues, please let me know.
    Thank you again for your time and patience throughout this issue.

    Regards

    Geetha

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Anatoli Titarev 40 Reputation points
    2023-09-12T13:16:43.8366667+00:00

    Thank you, GeethaThatipatri-MSFT, I followed your advice.


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.