I was always able to restore a bacpac to a SQL Server in Azure using a local file like this:
ds = new DacServices(connectionString);
ds.ImportBacpac(BacPackage.Load(filePath), dbTargetName,
new DacImportOptions {
...
}
});
Then I looked for a way to not fully load the bacpac to the memory, so I discovered that BacPackage.Load
has a 2nd argument that supposed to take care just for that so I used it like this:
BacPackage.Load(filePath, DacSchemaModelStorageType.File)
When I added that usage of the 2nd parameter, I started getting an exception when trying to restore the bacpac:
Error restoring data base to server: .NET Core should not be using a file backed model
Why can't I use it like that? I don't want to load the bacpac to the memory, so what can I do?