Azure SQL DACPAC 部署失败 - 不支持目标架构的兼容级别。

Azure SQL DACPAC Deploy Failure - The compatibility level of the target schema is not supported.

我似乎在将架构部署到 Azure SQL 数据库(上周创建,兼容性 140)时遇到问题。

我们有一个要部署到的 SSDT DACPAC 架构,它与 IaaS SQL Server 2016 实例完美配合,但是当将目标版本更改为 Azure SQL V12 并尝试部署到我们的 PaaS DB 通过 VSTS 我收到这个错误:

[error]错误SQL72020:不支持目标架构的兼容级别。

我们已尝试将 Compatbility MSBuild 值设置为 120,130,140 并将其留空 - none 似乎有所不同。以下是 .sqlproj 文件的摘录:

<PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <Name>DataSchema</Name>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectVersion>4.1</ProjectVersion>
    <ProjectGuid>{5d100d18-648c-4aac-9884-8a7b3c97f033}</ProjectGuid>
<DSP>Microsoft.Data.Tools.Schema.Sql.SqlAzureV12DatabaseSchemaProvider</DSP>
    <OutputType>Database</OutputType>
    <RootPath>
    </RootPath>
    <RootNamespace>CustomerData</RootNamespace>
    <AssemblyName>CustomerData</AssemblyName>
    <ModelCollation>1033,CI</ModelCollation>
    <DefaultFileStructure>BySchemaAndSchemaType</DefaultFileStructure>
    <DeployToDatabase>True</DeployToDatabase>
    <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
    <TargetLanguage>CS</TargetLanguage>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <SqlServerVerification>False</SqlServerVerification>
    <IncludeCompositeObjects>True</IncludeCompositeObjects>
    <TargetDatabaseSet>True</TargetDatabaseSet>
    <DefaultCollation>SQL_Latin1_General_CP1_CI_AS</DefaultCollation>
    <DefaultFilegroup></DefaultFilegroup>
    <TargetDatabase>Data</TargetDatabase>
    <CompatibilityMode></CompatibilityMode>
  </PropertyGroup>

从 MSDN 教程来看,它似乎应该像创建 SSDT DACPAC 项目一样简单,选择 SQL Azure V12 作为目标数据库类型,然后执行部署数据库任务作为发布的一部分。

请从here. There were similar issues with SSMS 17.4 that have been solved on SSMS 17.5 as explained here下载最新版本的SSDT。

所以我们想通了 - 但我不确定它是否是错误,Azure SQL 兼容性的默认值现在是 140 - 奇怪的是,当我们将模式兼容性设置为 140 时它仍然没有没用。

将 Azure SQL 数据库兼容级别设置为 130,并将 SSDT 项目设置为相同级别,部署成功。