Azure 忽略 WebJob 的计划设置
Azure is ignoring Scheduling settings for WebJob
我使用 Visual Studio 按照建议的方式部署了 WebJob,右键单击控制台项目,选择 "Publish as Azure Webjob" 并完成设置。
我选择了一个预定计划,导致在属性文件夹中创建文件“webjob-publish-settings.json
”,内容如下:
{
"$schema": "http://schemastore.org/schemas/json/webjob-publish-settings.json",
"webJobName": "TestCredentials2",
"startTime": "2016-04-05T01:00:00+01:00",
"endTime": "2016-04-12T00:00:00+01:00",
"jobRecurrenceFrequency": "Minute",
"interval": 3,
"runMode": "Scheduled"
}
虽然部署有效,但网络作业处于 "On Demand" 状态。 Webjob 运行 一次 当我从 Azure 门户中手动启动它但不会自动重新启动时。
我还尝试将“settings.job
”添加到我的项目的根目录(使用设置 "Copy if newer"):
{ "schedule": "0 /5 * * * *"
}
行为仍然没有区别,但也没有错误消息。
它确实使用 settings.job
方法工作。必须完成以下事情:
1. Create a settings.job with the content in the question
2. select Build Action "Content" for that file
3. Select "Copy if newer"
4. Delete the generated "Properties/webjob-publish-actions.json"
5. Re-Publish the Project, chose "On Demand" instead of a schedule plan
这会创建一个新的 webjob-publish-actions.json:
{
"$schema": "http://schemastore.org/schemas/json/webjob-publish-settings.json",
"webJobName": "MyTimer",
"startTime": null,
"endTime": null,
"jobRecurrenceFrequency": null,
"interval": null,
"runMode": "OnDemand"
}
完成。
我使用 Visual Studio 按照建议的方式部署了 WebJob,右键单击控制台项目,选择 "Publish as Azure Webjob" 并完成设置。
我选择了一个预定计划,导致在属性文件夹中创建文件“webjob-publish-settings.json
”,内容如下:
{
"$schema": "http://schemastore.org/schemas/json/webjob-publish-settings.json",
"webJobName": "TestCredentials2",
"startTime": "2016-04-05T01:00:00+01:00",
"endTime": "2016-04-12T00:00:00+01:00",
"jobRecurrenceFrequency": "Minute",
"interval": 3,
"runMode": "Scheduled"
}
虽然部署有效,但网络作业处于 "On Demand" 状态。 Webjob 运行 一次 当我从 Azure 门户中手动启动它但不会自动重新启动时。
我还尝试将“settings.job
”添加到我的项目的根目录(使用设置 "Copy if newer"):
{ "schedule": "0 /5 * * * *"
}
行为仍然没有区别,但也没有错误消息。
它确实使用 settings.job
方法工作。必须完成以下事情:
1. Create a settings.job with the content in the question
2. select Build Action "Content" for that file
3. Select "Copy if newer"
4. Delete the generated "Properties/webjob-publish-actions.json"
5. Re-Publish the Project, chose "On Demand" instead of a schedule plan
这会创建一个新的 webjob-publish-actions.json:
{
"$schema": "http://schemastore.org/schemas/json/webjob-publish-settings.json",
"webJobName": "MyTimer",
"startTime": null,
"endTime": null,
"jobRecurrenceFrequency": null,
"interval": null,
"runMode": "OnDemand"
}
完成。