1

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?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Matt B
  • 11
  • 1

2 Answers2

0

Solved the issue.

The $env:Path on our deployment server was set to use SQLDB\DAC\140\SqlPackage.exe but SQL Managed Instance will only work with SQLDB\DAC\150\SqlPackage.exe

Matt B
  • 11
  • 1
0

The error was already trying to explain the issue

A project which specifies SQL Server 2016 as the target platform cannot be published to SQL Server 2014.

So here you can find the Microsoft page for the target change when using DataPacs.

Pimenta
  • 1,029
  • 2
  • 13
  • 32