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?

5 Answers 5

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.

Sign up to request clarification or add additional context in comments.

Comments

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.

1 Comment

They are now supported in VS2012. Check my answer.
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).

2 Comments

If you use SQL 2008 R2 the SQL Azure Migration Wizard is no longer needed. Generating Azure supported scripts is fully supported now.
SQL 2008 R2 doesn't deploy data. The Wizard does. And also fixes common errors or gives information of why it doesn't work.
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.

Comments

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.

2 Comments

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.