c# - AzureWebJobs仪表板配置错误

标签 c# azure connection-string azure-webjobs azure-webjobssdk

我使用 .NET Framework 4.6 在 Visual Studio 2015 中创建了一个新的 Azure WebJob 项目。

在 app.config 中,我设置了三个连接字符串:

  1. AzureWebJobs仪表板
  2. AzureWebJobsStorage
  3. MyDatabaseConnectionString

AzureWebJobsDashboard 和 AzureWebJobsStorage 连接字符串相同,并且它们都指向我的存储帐户。我包含了其中一个连接字符串——因为除了“名称”之外,它们都是相同的。

<add name="AzureWebJobsDashboard" connectionString="DefaultEndpointsProtocol=https;AccountName=mystorageaccountname;AccountKey=thisIsTheLongPrimaryKeyICopiedFromAzurePortalForMyStorageAccount" />

一切看起来都对我来说,但我收到以下错误:

The configuration is not properly set for the Microsoft Azure WebJobs Dashboard. In your Microsoft Azure Website configuration you must set a connection string named AzureWebJobsDashboard by using the following format DefaultEndpointsProtocol=https;AccountName=NAME;AccountKey=KEY pointing to the Microsoft Azure Storage account where the Microsoft Azure WebJobs Runtime logs are stored.

顺便说一句,我知道 web 作业正在读取 app.config,因为我的代码能够连接到我的数据库并更新一些记录。

知道我做错了什么吗?

最佳答案

您需要在 Web 应用程序应用程序设置边栏选项卡的门户中设置 AzureWebJobsDashboard 连接字符串(执行步骤 here )。仪表板作为单独的站点扩展运行,并且无权访问 app.config。将连接字符串添加到设置边栏选项卡上的连接字符串部分。

如果您希望安全/一致性,您也可以在那里添加其他连接字符串(例如 AzureWebJobsStorage),而不是存储在 app.config 中,但是 WebJob 可以从 app.config 读取 AzureWebJobsStorage。

关于c# - AzureWebJobs仪表板配置错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34124804/

相关文章:

c - 语言 :C; Environment:Windows; Database: Azure Cloud

c# - 将焦点从一个列表框移动到另一个列表框

python-3.x - 将文件数据从 Azure Blob 存储访问到变量

azure - 使用 terraform 在 Azure 中创建网络接口(interface)时,使用现有的子网详细信息而不是再次创建

azure - 如何仅在 Azure 中托 pipe 域,而在其他地方托管主域?

.net - 如何将连接字符串从 appsettings.[name].json 传递到 .NET Core 中的 DbContext?

c# - 绘制阴影

c# - 当前上下文 mvc 4 中不存在名称 ViewBag

c# - 取消 session 的事件?

sql-server - 可以从连接字符串设置默认架构吗?