How to restore SQL Azure Bacpac to local SQL Server?
Have you created a .bacpac backup of your SQL Azure database and looking for ways to restore it to a local SQL Server instance? This article will walk you through the process of setting up backup from SQL Azure to local SQL Server.
We have mentioned two different techniques that can help you restore SQL Azure from BACPAC backup to a local SQL Server instance.
SQL Azure to local SQL Server using SQL Server Management Studio
This is a rather very easy way to restore SQL Azure database locally using SQL Server Management Studio.
- Right click on the Connection > Databases node and select “Import Data-tier application”
- Select “Next” on the introduction step.
- Browse, or connect to a storage account where you have kept the backup files, and you are done.
SQL Azure to local SQL Server using SQL Server Data Tools
This technique demonstrates the restoration process using the SQL Server Data Tools, freely available from Microsoft.
- Download the SQL Server Data Tools by going to this link https://msdn.microsoft.com/en-us/jj650015
- Install the SQL Server Data Tools on your local hard drive. Ideally, place it in the same directory as SQL Server ( will help in navigating and writing PowerShell queries)
- Now browse to the destination folder using command line or PowerShell.
- Execute the SqlPackage.exe file. Go to http://msdn.microsoft.com/en-us/library/hh550080(v=vs.103).aspx to see a list of all the parameter options for SqlPackage.exe
- Here is a sample command line that we used to import a .bacpac file into the local SQL Server instance.
.SqlPackage.exe /a:Import /sf:C:mydatabasefile.bacpac /tdn:Netreo /tsn:PARALEAP
- /tdn is the name of the database you want your .bacpac file to restore to.
- /tsn is the name of your SQL server.