Azure BLOB Storage Access on Azure SQL Database

Almost every data project would fall into the need of accessing files from some storage location. On premise servers used to access such files from a network file share but cloud platforms have their own storage infrastructure to store offline files. Let’s see how Azure SQL database or Azure SQL Managed Instance can be configured to access files stored on Azure blob storage containers.

There are at least two ways to access Azure blob storage from Azure SQL implementations – one using the account keys and second, using shared access signatures (SAS). Using SAS tokens is the recommended way to setup the access for blob storage so we will be covering the same here –

Step-1: Create a Master Key

Step-2: Create a database scoped credential

Step-3: Create an external data source that refers to the storage endpoint

Also, note that you when you use account key (though not a recommended way) to setup the credentials then you will have to keep your containers access level as container or anonymous. If you want your containers to be private but still accessible to database, you must use SAS to setup the credentials.

Leave a Reply