Sql-server – MS Azure remote back up with SqlPackage

azurebacpacexportsql server

I wanted to do an export of a .bacpac file from MS Azure database, from local machine, with command like this:

sqlpackage.exe /Action:Export /ssn:tcp:<ServerName>.database.windows.net,1433 /sdn:<DatabaseName> /su:<UserName> /sp:<Password> /tf:<TargetFile> /p:Storage=File

The DB was apparently found and the tool reported it started extracting the schema from the database, but then it fails:

Extracting schema
Extracting schema from database
Time elapsed 00:00:05.17
*** An unexpected failure occurred: .NET Core should not be using a file backed 
model..

To my surprise, I couldn't find anything similar on the web. Is this some kind of an MS Azure bug?

Best Answer

You can remove /p:Storage=File. This worked for me.

/p:Storage=File : is used to redirect the backing storage for the schema model used during extraction, this helpful with large databases that may cause out-of-memory exception if the default memory location is used. 

If this is not an issue for you, just omitting the parameter should fix your issue.