Unable to publish DACPAC to Azure SQL Database using sqlpackage.exe

前端 未结 2 1367
孤城傲影
孤城傲影 2021-01-23 14:57

When trying to apply a DACPAC to an Azure SQL Database I\'m getting the following from sqlpackage.exe:

*** An error occurred during deployment plan genera

2条回答
  •  庸人自扰
    2021-01-23 15:39

    Azure SQL is a PaaS Service which means it receives update transparently and relatively often with a new compatibility level.

    Azure SQL is now 150.
    When you create a new database it will be configured using the latest version. However, your machine, your deployment agents might not have the latest tooling deployed.
    When the tooling does not match the compatibility level of your database, the deployment will fail.

    If you are deploying using VSTS Hosted Agent you are not in control, and it will always lag a little behind. In that case, the easiest fix is to reduce your database Compatibility level.
    This is quite easy as you just need to run an SQL Statement on the database as follow:

    ALTER DATABASE database_name
    SET COMPATIBILITY_LEVEL =  130;
    

提交回复
热议问题