entity-framework - Azure WebJob 不再选取门户中的 Entity Framework 连接字符串设置

标签 entity-framework azure connection-string azure-webjobs

我的 Azure WebJob 已经运行了至少两年,没有出现任何问题。 app.config 包含以下内容...

<connectionStrings>
    <add name="UniversalModelEntities" connectionString="dummy - the actual connection string is specified in the portal but for some reason we need this element here" providerName="System.Data.EntityClient" />  
</connectionStrings>

在门户的应用程序设置中,我有...

enter image description here

运行没有任何问题...直到今天早上我发现错误

The connection string 'UniversalModelEntities' in the application's configuration file does not contain the required providerName attribute."

我在 Azure 门户中找到的有关 Entity Framework 连接字符串的所有内容都表明我应该将该下拉列表设置为自定义

那么问题出在哪里呢?

此外,我发现即使在 app.config 中声明完整的连接字符串,我仍然收到相同的错误消息,这表明问题出在门户的设置上。

最佳答案

我通过将连接字符串的下拉选项设置为SQLAzure...来解决这个问题

enter image description here

...这显然会导致错误,然后将其更改回自定义...

enter image description here

现在 WebJob 可以正确拾取连接字符串。

关于entity-framework - Azure WebJob 不再选取门户中的 Entity Framework 连接字符串设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49158899/

相关文章:

azure - 发布 Azure Web 应用程序 - 编译错误

azure - 在azure应用程序服务中存储数据库备份文件的最佳方式?

azure - AWS SimpleDb与Azure DocumentDb有何不同?两者与ElasticSearch有何不同

c# - 使用 SQLConnection 连接到 SQL CE 数据库

c# - 无法从 Windows 窗体应用程序中的 app.config 连接到本地 SQL 数据库

encryption - 在经典ASP中加密连接字符串

entity-framework - EF SaveChanges() 抛出异常 'The EntityKey property can only be set when the current value of the property is null'

database - 跨数据库 Entity Framework 支持

c# - 显示数据并在 View 上创建新数据(使用数据库 Entity Framework 中的代码优先)

c# - 奇怪的错误 : The type name 'Models' does not exist in the type . ... 播种实体数据库时