Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Visual Studio 2015 database project publish to both SQL Server _and_ Azure?

I have a solution that needs to target both SQL Server 2014 and Microsoft Azure SQL database V12.

In my project settings, if I set the target platform to Azure, I cannot publish to a SQL Server - I get this error:

A project which specifies Microsoft Azure SQL Database v12 as the target platform cannot be published to SQL Server 2014.

If I set the target platform to SQL Server 2014 and try to publish to an Azure database, I get the inverse error.

Is there any way to publish to both platforms without having to change the project settings each time?

Please note that I am not trying to migrate. I need to support both flavors of database with my scripts.

like image 783
Dave Montgomery Avatar asked May 25 '16 19:05

Dave Montgomery


1 Answers

When you deploy you can use AllowIncompatiblePlatform flag which should let it deploy.

I am using Azure V12 and Local Db Sql 2016 and it is publishing to the local db instance without the flag so maybe something changed in that version or the latest ssdt as well.

Edit 2020:

Local db is at 2016 and the latest Azure has some keywords that it doesn't support so using Local db is getting harder (probably isn't worth it anymore). A local dev instace or container is probably the way to go (or even a small azure sqldb per dev)

like image 185
Ed Elliott Avatar answered Oct 06 '22 17:10

Ed Elliott