What are SQL Server’s and Azure’s database deployment “BACPAC” files?
Posted: (EET/GMT+2)
When working with Azure SQL databases and/or the SQL Server Management Studio (SSMS), you might have run into something called "BACPAC" files. This refers to the file extension of these files.
Shortly put, these files can contain SQL Server database schema and data, and are used when moving data between local systems ("on-premises") and Azure cloud databases. Technically, Bacpac files are regular ZIP files, and thus by changing their file extension to .zip, you can easily view their contents.
Bacpack files contain both schematic information about the database ("the structure") and optionally, the database data from the selected tables. Thus, these files can also be used to back up and restore databases. Using SQL Server Management Studio, you can either take a copy of an Azure SQL database to your local computer and then restore the database locally on an SQL Server, or you can do it the other way around.
It's a little pity that in SQL Server Management Studio you cannot simply backup and restore a database like you would a regular, on-premises database, but with Bacpac files, the process is very similar.
Note, however, that the terminology is very different. To take a "backup" from an Azure SQL database, you export a data-tier application out of it. This takes both the schema and the data, and stores it (if you so choose) to a local file. On the local SQL Server, to "restore" your database, you import a data-tier application.
Again, note the difference in terminology.
Hope this helps!