AdamAVC
Hi,
I think I have a solution that will satisfy you:
SQLPACKAGE.EXE has a special parameter to specify an external model.xml file
(https://docs.microsoft.com/en-us/sql/tools/sqlpackage/sqlpackage-import?view=sql-server-ver16)
The .bacpac file, on the other hand, is actually a ZIP, which inside contains a script for creating database objects (model.xml) and data.
All you need to do is open the .bacpac with 7zip, winrar or a similar program, extract the model.xml file from it and edit it removing external users, external data sources and external tables.
Then use the sqlpackage.exe command more or less like this:
Actually, the proper tool for migrating databases from Azure SQL Database to Azure Managed Instance is seriously missing.
Exporting and importing a bacpac file with a 1.5TB database takes about 110h.