I'm trying to publish a dacpac extracted from a SQL Server 2016 on prem server to an Azure SQL Managed Instance using the below PowerShell, but this fails to the error below.
SqlPackage.exe /SourceFile:$DacPacFilePathName /Action:Publish /TargetServerName:$DatabaseServer /TargetDatabaseName:$DatabaseName /TargetUser:$User /TargetPassword:$Password
SqlPackage.exe : *** An error occurred during deployment plan generation. Deployment cannot continue.
At line:9 char:1
+ SqlPackage.exe /SourceFile:$DacPacFilePathName /Action:Publish /Targe ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (*** An error oc...annot continue.:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
A project which specifies SQL Server 2016 as the target platform cannot be published to SQL Server 2014.
If I create a new DB in the Azure Managed Instance and create a dacpac from that, I'm able to use the same PowerShell command to publish it and it works fine.
Any ideas what's causing this issue?