Exception of type “System.OutOfMemoryException” importing BacPac into Azure

Because of this question I thought I would try importing a BACPAC file into Azure SQL Server.

When I try and import a Data Tier Application ( a BACPAC file) to a new Azure database I get an out of memory exception.

enter image description here

When I ran the Data Migration Assistant I get 1 unsupported feature Azure SQL Database does not support trace flags

I wonder if that is why I get that error enter image description here


Posting as an answer due to the popularity of the comment...

Try closing SSMS and reopening it and trying the import again. I have found that if you have previously run some very large select statements that returned millions of rows the SSMS process is already using a lot of memory and more easily gets OutOfMemory errors. So closing and reopening SSMS helps avoid this.

The System.OutOfMemoryException is a .NET error which usually means the SSMS client tool is out of memory not that the server is out of memory.


One thing you can try is to import the Bacpac file using the Azure portal rather than the database. You would upload the Bacpac to Azure storage using a tool like Azure Storage Explorer, then point the portal to that to import it - https://docs.microsoft.com/en-us/azure/sql-database/sql-database-import