Move an On Premise SQL Server Database to the SQL Azure Cloud

Most of us have heard of SQL Azure, but a lot of people have yet to adopt the “cloud” version of SQL Server. This post will focus on how to move an on premise database to the SQL Azure and Windows Azure VM. To learn how to get started with SQL Azure visit Microsoft’s Azure site.

Most of us are used to the “Restore Database” command found by right clicking the Databases container in SQL Server Management Studio (SSMS). SQL Azure has done away with this and instead only gives you the options below:

On premise database Azure database

SQL Freelancer SQL Server Azure

SQL Freelancer SQL Server Azure

This isn’t very helpful and can make you want to deactivate your Azure subscription immediately, but hold on…there is a way.

First, you will need to create a storage account from Windows Azure. To do this, log in to Azure and click Storage, New from the left pane:

SQL Freelancer SQL Server Azure
Click Quick Create, Enter a URL and Location, and click Create Storage Account:

SQL Freelancer SQL Server Azure

Once the storage is created you should be able to view and manage it by clicking on the storage item on the left pane.

Click Manage Access Keys and take note of the Storage Account Name and Primary Access Key:

SQL Freelancer SQL Server AzureSQL Freelancer SQL Server Azure
Next click on the storage name and click Containers, Create a Container:
SQL Freelancer SQL Server AzureSQL Freelancer SQL Server Azure
Back in SSMS, right click on the database you want to move to the cloud and choose Tasks, Export Data-tier Application:

SQL Freelancer SQL Server Azure
Click Save to Windows Azure and the Connect…button.

SQL Freelancer SQL Server Azure
Click here to view the rest of this post.