计划的 Azure WebJob 无法 运行
Scheduled Azure WebJob fails to run
我有一堆 Web 作业 运行ning 作为 Microsoft Azure 中应用服务部署的一部分。这些作业都是基于 .NET 4.6 的 C# 控制台应用程序。
其中一项作业取决于调度程序。我有这个 webjob-publish-settings.json
文件:
{
"$schema": "http://schemastore.org/schemas/json/webjob-publish-settings.json",
"webJobName": "WebJobsRecurring",
"startTime": "2016-02-02T01:00:00+01:00",
"endTime": null,
"jobRecurrenceFrequency": "Day",
"interval": 1,
"runMode": "Scheduled"
}
当我发布与此 Web 作业关联的 Web 应用程序时,我可以在输出中看到 window 已创建计划:
9>Publish Succeeded.
9>Creating the scheduler job
9>Job schedule created
Web 作业也出现在门户和 Kudu 站点中,但从未 运行s。我第一次发布的时候它运行几次,但由于网站已经更新了几次,它就不能自动运行。当我从门户手动触发它时,它 运行s 并没有错误地完成。
2 月 19 日更新:调度程序日志出错
我按照@miracledev 的建议检查了调度程序日志,我发现了这个错误:
Http Action - Response from host 'domain.scm.azurewebsites.net': 'Unauthorized'
Response Headers: Date: Fri, 19 Feb 2016 00:02:03 GMT
Server: Microsoft-IIS/8.0
WWW-Authenticate: Basic realm="site"
Body: -- snip --
可能导致此错误的原因是什么?
(感谢@miracledev 为我指明了正确的方向。)
似乎没有使用正确的身份验证设置创建作业,可能是因为更多的开发人员可以发布并且他们可能具有不同的发布配置文件。
现在我已经通过将 WebJob 从 Scheduled
更改为 OnDemand
(在 webjob-publish-settings.json
文件中)解决了这个问题。
按照 David Ebbo's blog I have manually hooked up the scheduler. Note that this does not work from the new portal at the time of writing as it does not appear to accept the URL with username and password in it. It does, however, work from the old management portal (at manage.windowsazure.com 上的步骤进行操作。
现在 WebJob 再次成功触发。
我有一堆 Web 作业 运行ning 作为 Microsoft Azure 中应用服务部署的一部分。这些作业都是基于 .NET 4.6 的 C# 控制台应用程序。
其中一项作业取决于调度程序。我有这个 webjob-publish-settings.json
文件:
{
"$schema": "http://schemastore.org/schemas/json/webjob-publish-settings.json",
"webJobName": "WebJobsRecurring",
"startTime": "2016-02-02T01:00:00+01:00",
"endTime": null,
"jobRecurrenceFrequency": "Day",
"interval": 1,
"runMode": "Scheduled"
}
当我发布与此 Web 作业关联的 Web 应用程序时,我可以在输出中看到 window 已创建计划:
9>Publish Succeeded.
9>Creating the scheduler job
9>Job schedule created
Web 作业也出现在门户和 Kudu 站点中,但从未 运行s。我第一次发布的时候它运行几次,但由于网站已经更新了几次,它就不能自动运行。当我从门户手动触发它时,它 运行s 并没有错误地完成。
2 月 19 日更新:调度程序日志出错
我按照@miracledev 的建议检查了调度程序日志,我发现了这个错误:
Http Action - Response from host 'domain.scm.azurewebsites.net': 'Unauthorized'
Response Headers: Date: Fri, 19 Feb 2016 00:02:03 GMT
Server: Microsoft-IIS/8.0
WWW-Authenticate: Basic realm="site"
Body: -- snip --
可能导致此错误的原因是什么?
(感谢@miracledev 为我指明了正确的方向。)
似乎没有使用正确的身份验证设置创建作业,可能是因为更多的开发人员可以发布并且他们可能具有不同的发布配置文件。
现在我已经通过将 WebJob 从 Scheduled
更改为 OnDemand
(在 webjob-publish-settings.json
文件中)解决了这个问题。
按照 David Ebbo's blog I have manually hooked up the scheduler. Note that this does not work from the new portal at the time of writing as it does not appear to accept the URL with username and password in it. It does, however, work from the old management portal (at manage.windowsazure.com 上的步骤进行操作。
现在 WebJob 再次成功触发。