Msg 40616 Could not import package.
Applies to: Azure SQL Database.
Date created: February 21, 2019.
Problem Description.
Trying to move an on-premise SQL Server database to Azure SQL Database using
SQL Server Management Studio (SSMS) and its Deploy Database to SQL Azure Wizard
a user received the following error:
Microsoft SQL Server Management Studio
Operation Failed
Warning SQL0: A project which specifies SQL Server vNext CTP as the target
platform may experience
compatibility issues with Microsoft Azure SQL Database v12.
Error SQL72014: .Net SqlClient Data Provider: Msg 40616, Level 16, State 1, Line
1 'admin' is not a valid login name in this version of SQL Server.
Error SQL72045: Script execution error. The executed script:
CREATE LOGIN [admin]
WITH PASSWORD = '******';
(Microsoft.SqlServer.Dac)
The user also tried to create a bacpac file of the database, upload it to an
Azure storage account, and then import it to Azure SQL Database server, but got
the same error.
Cause.
Admin is not a valid login name on Azure SQL Database.
Solution.
Please try to remove the login Admin at the database level before trying to
migrate to Azure SQL Database again.
I usually recommend users to use
Azure
Data Migration Assistant (DMA) to migrate a SQL Server database to Azure
SQL Database, because it performs an assessment first and let you know things
you need to fix prior to migrate to Azure SQL. Once all incompatibilities are
fixed, DMA allows you to migrate with a couple of clicks.