Skip to main content
Tutorial: SQL Server Backup and Restore to Azure Blob Storage Service

Updated: February 16, 2017

Applies To: SQL Server 2016 Preview

This tutorial helps you understand how to write backups to and restore from the Azure Blob storage service.

This tutorial shows you how to create a Storage account, a blob container, creating credentials to access the storage account, writing a backup to the blob service, and performing a simple restore. This tutorial is divided into four lessons:

Lesson 1: Create Azure Storage Objects
In this lesson, you create an Azure storage account and a blob container.

Lesson 2: Create a SQL Server Credential
In this lesson, you create a Credential to store security information used to access the Azure storage account.

Lesson 3: Write a Full Database Backup to the Azure Blob Storage Service
In this lesson, you issue a T-SQL statement to write a backup of the AdventureWorks2012 database to the Azure Blob storage service.

Lesson 4: Perform a Restore From a Full Database Backup
In this lesson, you issue a T-SQL statement to restore from the database backup you created in the previous lesson.


To complete this tutorial, you must be familiar with SQL Server backup and restore concepts and T-SQL syntax. To use this tutorial, your system must meet the following requirements:

  • An instance of SQL Server 2016, and AdventureWorks2012 database installed.

    The SQL Server instance can be on-premises or in an Azure Virtual Machine.

    You can use a user database in place of AdventureWorks2012, and modify the tsql syntax accordingly.

  • The user account used to issue BACKUP or RESTORE commands should be in the db_backup operator database role with Alter any credential permissions.

Additional reading

Following are some recommended reading to understand the concepts, best practices when using Azure Blob storage service for SQL Server backups.

  1. SQL Server Backup and Restore with Microsoft Azure Blob Storage Service

  2. SQL Server Backup to URL Best Practices and Troubleshooting

Backing up the database and log
Creating a full file backup of the primary filegroup
Restoring a database and move files