There are a number of options for backing up SQL Azure, which can be found here:
Different ways to Backup your Windows Azure SQL Database
I like the Azure way, which is just exporting, importing and setting a scheduled
Before You Begin
The SQL Database Import/Export Service requires you to have a Windows Azure storage account because BACPAC files are stored here. For more information about creating a storage account, see How to Create a Storage Account. You must also create a container inside Blob storage for your BACPAC files by using a tool such as the Windows Azure Management Tool (MMC) or Azure Storage Explorer.
If you want to import an on-premise SQL Server database to Windows Azure SQL Database, first export your on-premise database to a BACPAC file, and then upload the BACPAC file to your Blob storage container.
If you want to export a database from Windows Azure SQL Database to an on-premise SQL Server, first export the database to a BACPAC file, transfer the BACPAC file to your local server (computer), and then import the BACPAC file to your on-premise SQL Server.
Export a Database
-
Using one of the tools listed in the Before You Begin section, ensure that your Blob has a container.
-
Log on to the Windows Azure Platform Management Portal.
-
In the navigation pane, click Hosted Services, Storage Accounts & CDN, and then click Storage Accounts. Your storage accounts display in the center pane.
-
Select the required storage account, and make a note of the following values from the right pane: Primary access key and BLOB URL. You will have to specify these values later in this procedure.
-
In the navigation pane, click Database. Next, select the subscription, your SQL Database server, and then your database that you want to export.
-
On the ribbon, click Export. This opens the Export Database to Storage Account window.
-
Verify that the Server Name and Database match the database that you want to export.
-
In the Login and Password boxes, type the database credentials to be used for the export. Note that the account must be a server-level principal login – created by the provisioning process – or a member of the dbmanager database role.
-
In New Blob URL box, specify the location where the exported BACPAC file is saved. Specify the location in the following format: “https://” + Blob URL (as noted in step 4) + “/<container_name>/<file_name>”. For example: https://myblobstorage.blob.core.windows.net/dac/exportedfile.bacpac. The Blob URL must be in lowercase without any special characters. If you do not supply the .bacpac suffix, it is applied by the export operation.
-
In the Access Key box, type the storage access key or shared access key that you made a note of in step 4.
-
From the Key Type list, select the type that matches the key entered in the Access Key box: either a Storage Access Key or a Shared Access Key.
-
Click Finish to start the export. You should see a message saying
Your request was successfully submitted
. -
After the export is complete, you should attempt to import your BACPAC file into a Windows Azure SQL Database server to verify that your exported package can be imported successfully.
Database export is an asynchronous operation. After starting the export, you can use the Import Export Request Status window to track the progress. For information, see How to: View Import and Export Status of Database (Windows Azure SQL Database).
![]() |
---|
An export operation performs an individual bulk copy of the data from each table in the database so does not guarantee the transactional consistency of the data. You can use the Windows Azure SQL Database copy database feature to make a consistent copy of a database, and perform the export from the copy. For more information, see Copying Databases in Windows Azure SQL Database. |
Configure Automated Exports
Use the Windows Azure SQL Database Automated Export feature to schedule export operations for a SQL database, and to specify the storage account, frequency of export operations, and to set the retention period to store export files.
To configure automated export operations for a SQL database, use the following steps:
-
Log on to the Windows Azure Platform Management Portal.
-
Click the SQL database name you want to configure, and then click the Configuration tab.
-
On the Automated Export work space, click Automatic, and then specify settings for the following parameters:
- Storage Account
- Frequency
- Specify the export interval in days.
- Specify the start date and time. The time value on the configuration work space is UTC time, so note the offset between UTC time and the time zone where your database is located.
- Credentials for the server that hosts your SQL database. Note that the account must be a server-level principal login – created by the provisioning process – or a member of the dbmanager database role.
-
When you have finished setting the export settings, click Save.
-
You can see the time stamp for the last export on under Automated Export in the Quick Glance section of the SQL Database Dashboard.
To change the settings for an automated export, select the SQL database, click the Configuration tab, make your changes, and then click Save.
Create a New SQL Database from an Existing Export File
Use the Windows Azure SQL Database Create from Export feature to create a new SQL database from an existing export file.
To create a new SQL database from an existing export file, use the following steps:
-
Log on to the Windows Azure Platform Management Portal.
-
Click a SQL database name and then click the Configuration tab.
-
On the Create from Export work space, click New Database, and then specify settings for the following parameters:
- Bacpac file name – This is the source file for your new SQL database.
- A name for the new SQL database.
- Server – This is the host server for your new SQL database.
- To start the operation, click the checkmark at the bottom of the page.
Import and Export a Database Using API
You can also programmatically import and export databases by using an API. For more information, see the Import Export example on Codeplex.
Import a Database
-
Using one of the tools listed in the Before You Begin section, ensure that your Blob has a container, and the BACPAC file to be imported is available in the container.
-
Log on to the Windows Azure Platform Management Portal.
-
In the navigation pane, click Hosted Services, Storage Accounts & CDN, and then click Storage Accounts. Your storage accounts display in the center pane.
-
Select the storage account that contains the BACPAC file to be imported, and make a note of the following values from the right pane: Primary access key and BLOB URL. You will have to specify these values later in this procedure.
-
In the navigation pane, click Database. Next, select the subscription, and then your SQL Database server where you want to import the database.
-
On the ribbon, click Import. This opens the Import Database from Storage Account window.
-
Verify that the Target Server field lists the SQL Database server where the database is to be created.
-
In the Login and Password boxes, type the database credentials to be used for the import.
-
In the New Database Name box, type the name for the new database created by the import. This name must be unique on the SQL Database server and must comply with the SQL Server rules for identifiers. For more information, see Identifiers.
-
From the Edition list, select whether the database is a Web or Business edition database.
-
From the Maximum Size list, select the required size of the database. The list only specifies the values supported by the Edition you have selected.
-
In the BACPAC URL box, type the full path of the BACPAC file that you want to import. Specify the path in the following format: “https://” + Blob URL (as noted in step 4) + “/<container_name>/<file_name>”. For example: https://myblobstorage.blob.core.windows.net/dac/file.bacpac. The Blob URL must be in lowercase without any special characters. If you do not supply the .bacpac suffix, it is applied by the import operation.
-
In the Access Key box, type the storage access key or shared access key that you made a note of in step 4.
-
From the Key Type list, select the type that matches the key entered in the Access Key box: either a Storage Access Key or a Shared Access Key.
-
Click Finish to start the import.
Database import is an asynchronous operation. After starting the import, you can use the Import Export Request Status window to track the progress. For information, see How to: View Import and Export Status of Database (Windows Azure SQL Database).