Skip to main content

Cloud

Windows Azure SQL Database – Automated SQL Export

With the July updates/enhancements of Windows Azure some changes have been made to SQL Database. In this article I’m going to talk about Automated SQL Export. Previously you had to manually export your database for backup. Now you can automate the export/backup schedule. If you need a Windows Azure subscription here is the link for a free trial.

In this post I’m going to assume you are familiar with the Windows Azure management portal and have some familiarity with SQL Database, formerly SQL Azure. I’m also going to assume you already have a SQL Database running in Windows Azure. Once you login to the management portal select one of your databases, preferably one that may need this feature, then click the “Configuration” section.
image
You will see there is an option for “Export Status” which is now set to “None.” Select “Automatic” and you will see more configuration options. This is where you set up the backup schedule and storage account for your backups.
image
You get complete control of the schedule, as frequent as once a day. One thing to note is that the retention policy is not enforced if you have the “Always keep at least one export” option checked. You will need to give your credentials for the SQL Database server. Once you have all the options specified click “save” and now your database should create backups automatically based on the schedule you specified. After you have it configured it will store your backups in the specified storage account in a .bacpac file.
NOTE: Your SQL Database server will need to be set to allow Windows Azure Services. You can check this by going to the configuration section on your database server. Select “Yes” for Windows Azure services if it isn’t already selected.
image
When you check your storage account after the first scheduled backup completes you will see a container called “automated-sql-export”. This container will hold all of your backups. You can also navigate to the “Dashboard” of the database and look under the “Quick Glance” section to see the last time an export occurred.
image
So as you can see, it is fairly easy to setup automatic backups in Windows Azure for your SQL databases. If you want to cut costs while using this feature, there are several things to be aware of. You should use a storage account in the same region as your database so as not to incur network bandwidth charges. Also, this feature creates a copy of the database so that your backup is transactionally consistent. This means that you will be charged for the temporary copy of the database while it is exporting, and the copy will be removed once the export completes.  It is also recommended to not keep more exports than necessary so that you’re not paying for storage of the backups you no longer need. So if costs may be an issue, you might want to backup once a week vs. every day depending on your needs.

Leave a Reply

Your email address will not be published. Required fields are marked *

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

Ryan Duclos

Ryan Duclos is a Lead Technical Consultant and CSM for Perficient, Inc. (PRFT), where he is passionate about Microsoft development utilizing the .Net Framework, SQL Server, and Microsoft Azure technologies. Ryan was a 2014 Microsoft MVP for Microsoft Azure. He lives and works in LA (Lower Alabama!) and loves spending time with his family, as well as being a Community Influencer for Microsoft. Ryan also a passion for Disc Golf and CrossFit! Ryan is a board member for the Lower Alabama .NET User Group and is also involved with the Pensacola SQL Server User Group, as well as other technical communities in his region. In addition, Ryan is a frequent speaker at numerous Code Camps, SQL Saturday & User Group events.

More from this Author

Follow Us
TwitterLinkedinFacebookYoutubeInstagram