5
votes

I appear to be having an issue with deploying a schema to an Azure SQL database (created last week, compatibility 140).

We have an SSDT DACPAC Schema to deploy to, which works perfectly fine with an IaaS SQL Server 2016 instance, but when changing the target version to Azure SQL V12 and attempting to deploy to our PaaS DB via VSTS I get this error:

[error]Error SQL72020: The compatibility level of the target schema is not supported.

We have tried setting the Compatbility MSBuild value to 120,130,140 and also left it blank - none of which seem to make a difference. Here is an excerpt of the .sqlproj file:

<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>

From the MSDN tutorials it seems it should be as simple as creating the SSDT DACPAC project, selecting SQL Azure V12 as the target DB type, and then executing the deploy db task as part of a release.

2
Have you tried using the "Allow Incompatible Platform" option when you publish it? Have you created a publish profile to see/control what options you're settingPeter Schott

2 Answers

2
votes

Please download the latest version of SSDT from here. There were similar issues with SSMS 17.4 that have been solved on SSMS 17.5 as explained here.

2
votes

So we figured this out - but i'm not sure if it is a bug or not, the default for Azure SQL compatibility is now 140 - oddly when setting our schema compatibility to 140 it still didn't work.

Setting the Azure SQL database compatibility level to 130 and the SSDT project to the same, the deployment worked.