如何在VSTS中停止连续工作并从计划Web作业中删除计划 [英] How to stop continuous and remove schedule from schedules web jobs in VSTS

查看:99
本文介绍了如何在VSTS中停止连续工作并从计划Web作业中删除计划的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在VSTS版本中,如何停止所有连续的webjob,并从触发的webjob中删除针对特定部署时段的计划?

In VSTS Release, how do I stop all continuous webjobs and remove schedule from triggered webjobs for specific deployment slot?

我有一个带有一堆webjobs的asp.net核心Web应用程序.其中有些是预定的,有些是连续的.

I have a asp.net core web application with bunch of webjobs. Some of them are scheduled, some are continuous.

在VSTS版本中,我使用Web Deploy将Webjob和Web应用程序一起部署到App Service.

In VSTS Release I deploy the webjobs together with web app to App Service using Web Deploy.

但是,在临时环境中,我不想运行webjobs,因为它们会干扰生产(共享同一数据库等).

However, in staging environment I don't want to run the webjobs, since they would interfere with production (the share the same database, etc).

我想我必须写一些powershell才能停止webjobs.归结为以下步骤:

I guess I would have to write some powershell to stop the webjobs. It comes down to these steps:

  1. 如何在连接到Azure订阅的VSTS中运行PowerShell
  2. 如何列出我的Web应用程序和部署位置的所有Web作业
  3. 如何停止连续的网络作业
  4. 如何将触发器设置为手动,并从计划的网络作业中删除计划

推荐答案

您可以在临时插槽上设置两个粘性应用程序设置:

You can set two sticky app settings on the staging slot:

  • WEBJOBS_STOPPED :1
  • WEBJOBS_DISABLE_SCHEDULE :1
  • WEBJOBS_STOPPED: 1
  • WEBJOBS_DISABLE_SCHEDULE: 1

实际上不确定是否需要第二个. 来源: Kudu Wiki

Actually not sure if you need the second one even. Source: Kudu Wiki

然后,WebJob将不会在该插槽上运行,并且通过将插槽设置​​为粘性(即插槽设置),它们将停留在暂存插槽上,而不会与应用程序交换.

Then WebJobs will not run on that slot, and by setting the slots sticky (i.e. slot settings), they will stay on the staging slot and not be swapped with the app.

这篇关于如何在VSTS中停止连续工作并从计划Web作业中删除计划的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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