I got error on sqlpackage for mac...

woodymoo 256 Reputation points
2023-03-12T18:27:20.92+00:00
SqlPackage /Action:Publish /SourceFile:"./xxx.dacpac" \
  /TargetDatabaseName:xxx /TargetServerName:xxx.database.windows.net \
  /tu:xx /tp:'xxx' /TargetTrustServerCertificate:True  

Error message:


Publishing to database 'xxx' on server 'xxxx.database.windows.net'.

Initializing deployment (Start)

Initializing deployment (Failed)

*** An error occurred during deployment plan generation. Deployment cannot continue.

A project which specifies SQL Server 2022 or Azure SQL Database Managed Instance as the target platform cannot be published to Microsoft Azure SQL Database v12.

Time elapsed 0:00:03.82


Docker Image: mcr.microsoft.com/mssql/server:2022-latest. (Linux amd64 )

sqlpackage version 16.1.8980.0

Mac os version: 13.2.1. ( M1 Max)

Azure SQL Database
{count} votes

2 answers

Sort by: Most helpful
  1. Erland Sommarskog 102.3K Reputation points
    2023-03-12T19:04:39.9633333+00:00

    Not that I use SqlPackage or Database Projects, but doesn't the error message make it quite clear what is going on? Your project is target for SQL 2022 or Azure Managed Instance, and now you are trying to deploy it on Azure SQL Database. You need to change the target for your project.

    The fact that you are running from a Mac should have nothing to do with it.

    0 comments No comments

  2. woodymoo 256 Reputation points
    2023-03-15T15:41:16.1766667+00:00

    Thank you for comments.

    I solved the issue by use Azure Data Studio for Mac with latest Sql Server Dacpac Extention ( 1/20/2023 version) .

    The database schema and all the tables was successfully published.

    Thanks,

    0 comments No comments