azure - 为什么需要在 Azure 管理门户中而不是在 Web 作业的 App.config 中配置 Web 作业的连接字符串?

标签 azure azure-storage azure-webjobs azure-webjobssdk

我通过右键单击我的 WebApp 项目并添加新的 Azure Web 项目创建了计划的 Azure WebJob。我在 WebJob 项目的 App.config 中设置了 AzureWebJobsDashboard 和 AzureWebJobsStorage 连接字符串。我暂时将默认代码保留在 .cs 文件中。接下来,我从 Visual Studio(顺便说一下,2013 Update 4)发布到 Azure 网站。它创建了 WebJob,我可以从 Azure 管理站点或 Visual Studio 运行它,并且它是成功的。我可以在我期望的位置看到输出日志。但是,Azure WebJob 详细信息页面显示以下警告/错误:

Make sure that you are setting a connection string named AzureWebJobsDashboard in your Microsoft Azure Website configuration 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.

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.

它还提供了一个指向 http://azure.microsoft.com/blog/2013/07/17/windows-azure-web-sites-how-application-strings-and-connection-strings-work/ 的链接这并不能解释为什么我收到错误消息。

现在,为了消除此警告/错误,我在 Azure 管理站点的配置页面中添加相同的 AzureWebJobsDashboard 连接字符串。

所以,我试图弄清楚我是否做错了什么,或者这是否只是 Microsoft 尚未修复的 WebJobs 中的一个问题。我真的希望能够在 App.config 中包含此内容,而不必记住在我们为不同环境创建的每个网站中进行设置。

非常感谢您的时间和帮助。

最佳答案

仪表板无法访问您的 Web 作业的 app.config 文件,即使可以访问,您也可能有多个 Web 作业,因此它不知道要选择哪个连接字符串。这就是您需要在门户中设置连接字符串的原因。

但是,如果您在门户中设置它们,则不必在 Web 作业的 app.config 中进行设置。 WebJobs SDK 知道如何从那里读取它们。

关于azure - 为什么需要在 Azure 管理门户中而不是在 Web 作业的 App.config 中配置 Web 作业的连接字符串?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28077330/

相关文章:

azure - 将单个表数据推送到 Azure

asp.net-mvc-3 - 如何在 Azure 云服务上发布之前预编译 Web 应用程序

node.js - Azure Cosmos + Gremlin NodeJS,如何以脚本形式提交流畅的查询(不是字节码——我知道它还不支持)

c# - 我们如何跟踪azure文件存储文件夹是否更新?

c# - 一个队列上的多个 Azure Webjob 实例(第 2 部分)

Azure Web 作业 - 来自队列的并行消息处理无法正常工作

linux - 如何使用 Packer 创建带有 Linux 自定义分区的 Azure VM

azure CloudBlobDirectory.ListBlobs() 返回 "The specified resource does not exist.",但 fetchAttributes() 使用相同的数据

asp.net - 将图像保存到在 azure 上不起作用的文件夹

azure - 如何通过 VSTS 将 Azure WebJob 和应用程序部署到同一应用程序服务?