azure - 部署解决方案后,Windows Azure SQL 数据库连接字符串不起作用

标签 azure azure-sql-database

我有一个连接到 SQL Azure 数据库的 MVC3 解决方案 (EF 5/Net 4.5)。当我在本地运行该解决方案时,它被配置为连接到 SQL Azure 数据库,该解决方案工作正常。但是,当我将解决方案发布到 Azure 时,与 SQL Azure 数据库的连接不起作用。

ServiceConfiguration.Cloud.csfg 和 ServiceConfiguration.Local.csfg 文件中的连接字符串相同。我还通过 Azure 门户确保运行 Azure SQL DB 的服务器将“Windows Azure 服务”作为“允许的服务”设置为"is" 连接字符串是:

<Setting name="SQLDataConnectionString" value="metadata=res://*/FooDB.csdl|res://*/FooDB.ssdl|res://*/FooDB.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=tcp:sahjjh7.database.windows.net,1433;Database=FooDB;User ID=<real user id>;Password=<real password>;Trusted_Connection=False;MultipleActiveResultSets=True;Encrypt=True;Connection Timeout=30;&quot;" />

有什么指点吗? 谢谢!

最佳答案

我不相信 Entity Framework 知道如何从 ServiceConfiguration 中获取连接字符串。是你自己指的吗?如果不是,这实际上可能是 web.config 转换的问题。

关于azure - 部署解决方案后,Windows Azure SQL 数据库连接字符串不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15017165/

相关文章:

Azure服务总线绑定(bind)类型 'serviceBusTrigger'未注册python函数

Azure存储错误: Object reference not set to an instance of an object

sql - Azure SQL : External table is different than the column's data type in the underlying standalone or sharded table present on the external source

sql - Azure SQL 数据迁移助手 (DMA) 错误 - 三个或四个部分名称

azure-sql-database - 如何使用 JetBrains DataGrip 连接到远程 Microsoft Azure 数据库

sql-server - 将 Azure SQL 数据库 (PaaS) 复制到 IaaS(VM 上的 SQL 服务器)

python - 尝试使用 MSI 身份验证从 Azure ML 服务连接 Azure SQL 数据库(无需用户名和密码即可连接 Azure 数据库)

Azure 计算能力 : Extra Large VM slow

Azure 删除孤立磁盘

git - 由于缓存凭据错误,无法将代码推送到 Azure DevOps