Azure : Direct SQL Server to Storage Account Backup

Introduction
Did you know you can back up (and restore) your SQL data to (and from) your Azure Storage Account? No… Check out the following article ; SQL Server Backup to URL

IC639738.jpeg

How does that look in reality?
Browse to your storage account and click on “Manage Access Keys”…
2015-09-04 10_30_23-Storage - Microsoft Azure

Copy the “Primary Access Key” to your clipboard…
2015-09-04 10_30_56-Storage - Microsoft Azure

Now head over to your SQL Management studio and create the following credential…

CREATE CREDENTIAL [https://kvaestest01.blob.core.windows.net/sqlbackup] WITH IDENTITY='kvaestest01', SECRET='Dnwkn...SydB...gfsZjm...TJ9Ew=='

  • Credential Name : The url of your backup location
  • Identity : The name of your storage account
  • Secret : The primary access key

And you will see it pop up in your objects…

2015-09-04 10_31_29-kvaestest01-6 - kvaestest.cloudapp.net_55099 - Remote Desktop Connection

Now we are ready for the action!

BACKUP DATABASE AdventureWorks2012 TO
URL = 'https://kvaestest01.blob.core.windows.net/sqlbackup/AV2012_01.bak'
WITH CREDENTIAL = 'https://kvaestest01.blob.core.windows.net/sqlbackup'
,COMPRESSION
,STATS = 5;
GO

One thing to note. You can only use one URL in your backup command. So multiple backup files for concurrency reasons is sadly not possible.

Have fun!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.