【问题标题】:Azure Api App connection string for EF not workingEF 的 Azure Api App 连接字符串不起作用
【发布时间】:2017-11-17 12:47:15
【问题描述】:

我创建了一个 Web Api 项目并在其中添加了实体框架 6。

并在 Azure 门户中的 App 服务中创建 API App,并在此应用中发布 Web Api 项目。

一切正常,但是当我从 Web.config 文件中删除连接字符串并在 azure 应用程序中设置连接字符串时

关注这个https://social.msdn.microsoft.com/forums/azure/en-US/62b9fa9d-7a4a-4927-a702-3e1e834d5187/azure-web-sites-connection-string-for-ef-not-being-picked-up

不工作。

我已将这个虚拟连接字符串放入我的 web.config 文件中

请帮助我做错了什么,或者 Azure 门户中的 API App 有另一种方法。

【问题讨论】:

  • 我可以看到您使用 SQL Server,但在链接的问题中,作者选择了连接类型 Custom。请改用 SQL 数据库SQL Server

标签: entity-framework azure asp.net-web-api


【解决方案1】:

网络配置中的连接字符串将有" 用于转义引号。在添加到 azure app services 连接字符串之前,您需要将它们更改为 ''

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-01-26
    • 1970-01-01
    • 1970-01-01
    • 2018-09-03
    • 2013-02-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多