3
votes

I'm exporting a bacpac file from my Azure SQL Server database to my local file system. Then when I try to import this bacpac file into a local instance of SQL Server I get a "Archive file cannot be size 0." error.

I've tried the import via the GUI Import Data-tier Application functionality as well as executing the SqlPackage.exe via the command prompt. I recieve the same error either way.

Any ideas?

Via the GUI within ssms:

Via the command prompt:

3

3 Answers

6
votes

When you are exporting a Sql database in Azure to bacpac blob in Azure Storage, only a request is submitted to Azure. You have to wait until that request is completed (could be some time if the database is large). If you try to download the file before the request is completed the file will be size 0 and the SSMS import will fail.

2
votes

This error turned out to be because there was nothing in the bacpac file. When exporting from Azure it failed the export but still created the file. So I didn't realize it failed.

0
votes

If you recently exported a database, you need to wait for it to complete before you can import. You can see the export status in Import/Export history in the server option

enter image description here