How easy is it to deploy your database to the cloud?

With the current hype in cloud computing, DBA’s want to have an easy way to deploy their database to SQL Azure. In previous versions, migrating a database to the cloud was a significant undertaking. You could download the SQL Azure Migration Wizard which actually created some scripts to move your database. Microsoft also provided following solution Migrating Databases to SQL Azure.  Other possibilities are BCP, building SSIS packages, “Generate script wizard”,…

I was wondering why it has to be that “difficult” and “complex”.  People are still using these solutions, which are certainly not bad, believe me, but…Now. with SQL Server Management Tools in SQL 2012  you can use the Deploy Database to SQL Azure feature, which under the hood exports a bacpac and then imports it to SQL Azure. It makes the life of the DBA much easier.  Let’s see how this works.

Open the Object Explorer and go to your database that you want to deploy. Right click on it and select Tasks – Deploy Database to SQL Azure

image

You should now see an introduction screen of the deploy wizard.  Just click next…

2

Now you need to specify the deployment settings.  First of all, you need to connect to your SQL Azure Server. Click the connect button.

image

Enter your SQL Azure credentials and click the connect button. Please note that the connection to a SQL Azure server in some companies can fail.  Probably because of firewall settings. …this company is not ready yet for the cloud… Denkende emoticon.

image

Once you are connected, specify the correct database name.
Select the Edition (Web or Business) of SQL Azure and the maximum database size that you need.  For more information on SQL Azure and Pricing check out this link

image

image

When you click next,you will get a summary of the specified settings

image

Click Finish to start the deployment to SQL Azure. The wizard will first evaluate your database if it meets all the requirements of SQL Azure. If not,it will fail, as you can see below Knipogende emoticon.

image

If you click on the “error link” to verify what is wrong.  In my case, I have a table with no clustered index.  That’s not allowed in SQL Azure.  Check the following page if you want an overview of the Guidelines and Limitations (SQL Azure Database)

image

You need to restart the wizard all over again.  Microsoft didn’t provide a retry button here…
I have corrected my database and retried the deploy again. Successful! As you can see, the wizard is first exporting the database, the schema and the data itself. Secondly a database on the SQL Azure is created, schema and data are imported.

image

Now let’s verify if my database is indeed deployed correctly.
When I check the Windows Azure Platform, I find indeed my new deployed database

image

Conclusion: The other deployment tools were very useful in previous versions but when you have installed SQL Server 2012, I really should recommend this new feature.