I can able to fix it by changing from this line "<DSP>Microsoft.Data.Tools.Schema.Sql.SqlAzureV12DatabaseSchemaProvider</DSP". to "<SqlServerVersion>SqlAzure</SqlServerVersion>".
Now publish to azure sql is working.
Thanks
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi Team,
I have below csproj file to build dacpac.
<Project Sdk="MSBuild.Sdk.SqlProj/2.0.0">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<DSP>Microsoft.Data.Tools.Schema.Sql.SqlAzureV12DatabaseSchemaProvider</DSP>
</PropertyGroup>
<ItemGroup>
<Content Include="..\dbo\**\*.sql" />
<Content Include="..\jobs\*.sql" />
<Content Include="..\PostDeploymentScript\*.sql" />
</ItemGroup>
<ItemGroup>
<Content Remove="..\PostDeploymentScript\*.sql" />
<None Include="..\PostDeploymentScript\*.sql" />
</ItemGroup>
<ItemGroup>
<PostDeploy Include="..\PostDeploymentScript\Script.PostDeployment.sql" />
</ItemGroup>
</Project>
And build is getting succeed by using below command,
msbuild /t:Build Database.Build.csproj /p:Configuration=Release /p:Platform="Any cpu" /p:OutDir=/database.build/output
But when trying to use for publish to Azure SQL database using sqlpackage in ubuntu am getting below error,
"*** An error occurred during deployment plan generation. Deployment cannot continue.
A project which specifies SQL Server 2019 as the target platform cannot be published to Microsoft Azure SQL Database v12."
And here is my sqlpackage command,
sqlpackage /action:Publish /SourceFile:"/database.build/output/Database.Build.dacpac" /TargetConnectionString:"Data Source=tcp:dev-sqlserver-shared-sql.database.windows.net,1433;Initial Catalog=test-dev;Persist Security Info=False;User ID=XXXX;Password=YYYYYY;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30"
Can someone please help regarding this issue.
I can able to fix it by changing from this line "<DSP>Microsoft.Data.Tools.Schema.Sql.SqlAzureV12DatabaseSchemaProvider</DSP". to "<SqlServerVersion>SqlAzure</SqlServerVersion>".
Now publish to azure sql is working.
Thanks