通过部署Git的计划Azure的WebJob导致按需工作 [英] Scheduled Azure WebJob deployed via Git results in On Demand Job

查看:142
本文介绍了通过部署Git的计划Azure的WebJob导致按需工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Git启用ASP.NET Web应用程序与一个关联的Azure WebJob。当我通过Visual Studio的一切部署,这是好的,但这是有点难以在持续交付环境,所以我想发布Web App和通过的Git的WebJob。

I have a Git-Enabled ASP.NET WebApp with one associated Azure WebJob. When I deploy this via Visual Studio everything is fine, but this is kinda hard in a Continuous Delivery Environment so I would like to publish the Web App and the WebJob via Git.

通过在Azure工具我有关我的WebJob项目,我得到了Web应用程序项目内的webjobs-list.json文件:

Via the Azure Tooling I associated my WebJob project and I got a "webjobs-list.json" file inside the WebApp Project:

{
"$schema": "http://schemastore.org/schemas/json/webjobs-list.json",
"WebJobs": [{
  "filePath": "../CodeInside.Hub.Job/CodeInside.Hub.Job.csproj"
  }]
}

结果
<一href=\"https://github.com/$c$c-Inside/Hub/blob/master/$c$cInside.Hub/$c$cInside.Hub.Web/Properties/webjobs-list.json\">webjobs-list.json来源

控制台应用程序项目中我得到了与此内容webjob - 发布 - settings.json的文件:

Inside the Console App Project I got a "webjob-publish-settings.json" file with this content: 

{
"$schema": "http://schemastore.org/schemas/json/webjob-publish-settings.json",
"webJobName": "Hub-Crawler",
"startTime": "2014-11-25T02:00:00+01:00",
"endTime": null,
"jobRecurrenceFrequency": "Day",
"interval": 1,
"runMode": "Scheduled"
}

<一个href=\"https://github.com/$c$c-Inside/Hub/blob/master/$c$cInside.Hub/$c$cInside.Hub.Job/Properties/webjob-publish-settings.json\">webjob-publish-settings.json

正如你可以看到runMode设置为定,当我通过Visual Studio中部署它,一切都很好。

As you can see the "runMode" is set to "Scheduled" and everything is fine when I deploy it via Visual Studio.

但是,如果没有Visual Studio中我得到了这个按需WebJob:

But without Visual Studio I got this "on demand" WebJob:

这是目前不支持或可能是什么问题?

Is this currently not supported or what could be the problem?

完整的.sln可以 GitHub上

推荐答案

有终于与git的部署安排部署一个webjobs解决方案。

There is finally a solution for deploying scheduled webjobs with git deployment.

博客有更多的细节。

该解决方案使用,而不是在Azure调度的调度捻所以在Azure门户网站仍显示工作作为按需,但它确实按计划执行和门户准确地展示历史。

The solution uses the kudu scheduler as opposed to the Azure scheduler so the Azure portal still shows the job as "On Demand" but it does execute per schedule and the portal shows history accurately.

这篇关于通过部署Git的计划Azure的WebJob导致按需工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆