REST API Sample for exporting a database

While working on an Azure SQL Database support case, I needed to provide a REST API sample for exporting a database. I struggled a bit to get it to work, as the syntax is not really intuitive and requires creating an Azure AD application. To save you from the same struggle, here is the sample…


PolyBase export of datetime values does not use DATE_FORMAT

This topic came up on a recent support case I had worked on. The customer had stored the data in an Azure SQL Data Warehouse database, but needed to move it into Azure blob storage for consolidating data from different sources. This also required to write the datetime values in a specific format. The idea…


Lesson Learned #25: Export/Import Azure SQL Database using Azure File Service?

In some situations, we need to import or export our Azure SQL Database using SQLPackage, but, unfortunately, either source and destination file we cannot specify a blob storage, in case that we want to save the file in this storage. For this reason, we have to use a local temporal folder for uploading/downloading the file depending on our needs. However,…


Exported database from Azure SQL failed to be imported to Azure SQL or to local SQL Server

Symptoms:  When using blob auditing on Azure SQL Server or Database, after you export database to .bacpac file if you import the database to another Azure SQL DB that already have blob auditing enabled at the server level you may get this error message: Could not import package. Error SQL72014: .Net SqlClient Data Provider: Msg…


BACPAC Export failing with Unable to reconnect – Timeout expired

I had a support case recently where the export of a SQL Server database into a BACPAC file was failing. The first attempt was done through SQL Server Management Studio 2016, by right-clicking the database -> Tasks -> Export Data-Tier Application. Another attempt using the sqlpackage.exe command-line tool showed the identical results though. The following operations…