Visual Studio 数据库项目不会部署到 SQL Azure
我遇到了与这个非常相似的问题。我有一个 .dbproj Visual Studio 数据库项目。它在 SQL Server Express 中部署得很好。现在我想将其部署到 SQL Azure - 我更改了连接参数,但部署失败并显示以下文本:
C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\TeamData\Microsoft.Data.Schema.TSqlTasks.targets(120,5):错误 Deploy01234:无法确定目标数据库架构提供程序。部署无法继续。 完成执行任务“SqlDeployTask”——失败。
是否支持将 .dbproj 项目部署到 SQL Azure?如何让 Visual Studio 将数据库部署到 SQL Azure 中?除了使用 Azure 门户手动重新创建数据库之外,还有哪些其他方法可以实现大致相同的结果?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
当我们第一次构建数据库项目时,SQLAzure 仍在经历身份危机,并且不知道自己想要成为什么。 ;)
与 SQLAzure 相比,DBProjects 支持重要的功能超集。因此,它很可能会创建无法针对 SQLAzure 运行的脚本。
我知道接管 DBProject 工具的团队正在考虑限制数据库项目生成器输出 SQLAzure 兼容的脚本,但我不知道他们走了多远,也不知道他们是否决定继续。
我回应上面 dunnry 的建议,并使用 SQL Azure 迁移向导 或 Jeremy 的建议,并使用 SQL 2008 R2 并生成 Azure 兼容的脚本。
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.
如果您使用的是 Visual Studio 2012,您现在可以创建一个数据库项目并转到“属性”- 在“项目设置”选项卡中将其目标平台设置为 SQL Azure。您还可以配置 dacpac 输出的设置。使用此文件直接导入为新的 SQL Azure 数据库。
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.
据我所知,Windows Azure 仍然不支持数据库项目。您可以将项目部署到本地 SQL 服务器,然后使用“生成脚本”功能将数据库移植到 SQL Azure。请参阅此链接。
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.
一个简单的解决方案是在本地创建数据库并使用 SQL Azure 迁移向导 迁移到 SQL Azure 。只需点击几下即可运行良好(并且可以修复常见错误)。
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).
数据库项目不适用于 SQL Azure。我所做的是在部署之前,在本地服务器上创建一个全新的数据库(以确保它是最新的,没有开发脚本),然后使用 RedGate SQL Compare 将该数据库同步到 Azure。我首先使用 RedGate SQL Azure Backup 进行备份。
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.