6

I've ran into problem very similar to this. I have a .dbproj Visual Studio database project. It deploys just fine in SQL Server Express. Now I want to deploy it to SQL Azure - I change the connection parameters but deployment fails with the following text:

C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\TeamData\Microsoft.Data.Schema.TSqlTasks.targets(120,5): Error Deploy01234: The target database schema provider could not be determined. Deployment cannot continue. Done executing task "SqlDeployTask" -- FAILED.

Is deploying .dbproj projects to SQL Azure supported? How do I make Visual Studio deploy the database into SQL Azure? What are other ways to achieve more or less the same results except recreating the database manually using Azure portal?

Community
  • 1
  • 1
sharptooth
  • 167,383
  • 100
  • 513
  • 979

5 Answers5

10

If you are using Visual Studio 2012, you can now create a Database project and go to Properties - set its Target Platform to SQL Azure in Project Settings tab. Also you can configure the setting for dacpac output. Use this file to import directly as a new SQL Azure database.

whihathac
  • 1,741
  • 2
  • 22
  • 38
5

As far as I know, Database projects are still not supported by Windows Azure. You can deploy the project to a local SQL server and then use the "Generate Scripts" feature to port the database to SQL Azure. See this link.

Jeremy Seekamp
  • 2,746
  • 1
  • 22
  • 25
4

An easy solution is to create the database locally and use the SQL Azure Migration Wizard to do the migration up to SQL Azure. It works very well in just a few clicks (and will fix common errors).

dunnry
  • 6,858
  • 1
  • 20
  • 20
  • If you use SQL 2008 R2 the SQL Azure Migration Wizard is no longer needed. Generating Azure supported scripts is fully supported now. – Jeremy Seekamp Jul 07 '11 at 16:08
  • SQL 2008 R2 doesn't deploy data. The Wizard does. And also fixes common errors or gives information of why it doesn't work. – Ralf de Kleine Jul 08 '11 at 10:42
2

Database projects don't work with SQL Azure. What I do is before deploying, create a brand new database on local server (to ensure it is up to date with no dev scripts), and then sync that database to Azure with RedGate SQL Compare. I do a backup first with RedGate SQL Azure Backup.

Craig
  • 36,306
  • 34
  • 114
  • 197
1

When we first built DB projects, SQLAzure was still going through its identity crisis and didn't know what it wanted to be. ;)

DBProjects support a significant superset of capabilities vs. SQLAzure. Therefore, it's quite possible that it'll create scripts that won't run against SQLAzure.

I know that the team who took-over the DBProject tooling were looking at restricting the database project generators to output SQLAzure-compatible scripts, but I don't know how far they got or whether they decided to proceed.

I echo dunnry's suggestion above and use the SQL Azure Migration Wizard or Jeremy's and use SQL 2008 R2 and generate Azure-compatible scripts.

Rich Turner
  • 10,800
  • 1
  • 51
  • 68
  • While the DBProjects team are at it, they can also add capability to generate a script that can be copied into SSMS and run, rather than relying on VS to deploy. Then DBProjects will be half useful for deployment. – Craig Jul 08 '11 at 04:24
  • using the SQL Azure Migration wizard is fine for a manual process, but how do you best do this in an automated build and deployment? I can't script the wizard, can I? – ryancrawcour Feb 07 '12 at 23:20