azure-sql-databaseazure-devopssqlproj

how do I target azure v12 database for sqlproj from the build command


We have a sqlproj that targets SQL 2014 locally. The build and publish work as expected from Visual Studio.

Now we are trying to build and deploy the database project to Azure Database v12 using VS Online. We are getting errors stating the SSDT targets the wrong database. This makes sense as Azure Database and SQL 2014 surpport different features and produce different warnings/errors. Every article/post we have found online shows how to change the target platform from the GUI at design time.

Our assumption is the platform can be targeted at build time, same as changing the target platform of a class library. However we are not able to locate a list of available arguments for a sqlproj targetplatform.

Does anyone have a link or know the key=value property to set for the VS Online build parameters?
Thank you


Solution

  • The value is stored in DSP property of project, so you can specify /p:DSP=Microsoft.Data.Tools.Schema.Sql.SqlAzureV12DatabaseSchemaProvider MSBuild argument in Visual Studio Build task.