Quick answer: This DACPAC deployment error occurs when the SQL database project’s target platform is incompatible with the Azure SQL Database target. Set the project target platform to Microsoft Azure SQL Database, rebuild the DACPAC, and deploy the newly built package.

Error

##[error]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.

Azure SQL DACPAC deployment target platform error

Solution

1. Open the SQL database project in Visual Studio.

2. Right-click the database project and select Properties.

3. Open the Target platform setting and select Microsoft Azure SQL Database.

Change SQL database project target platform to Azure SQL Database

4. Save the project and rebuild it to generate a new DACPAC.

5. Deploy the newly built DACPAC through your Azure DevOps pipeline.

The target platform is part of the DACPAC build artifact and is checked against the target database during deployment. A mismatch can prevent deployment from starting.

See more

Pro tips:
Make the target platform match the actual Azure SQL Database target before building the DACPAC. This allows the project build to identify unsupported database features earlier.

Kunal Rathi

With over 15 years of experience in data engineering and analytics, I've assisted countless clients in gaining valuable insights from their data. As a dedicated supporter of Data, Cloud and DevOps, I'm excited to connect with individuals who share my passion for this field. If my work resonates with you, we can talk and collaborate.