How to stop continuous and remove schedule from schedules web jobs in VSTS

房东的猫 提交于 2020-06-29 04:44:05

问题


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

scenario:

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

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

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

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

  1. How do I run PowerShell in VSTS that is connected to my Azure Subscription
  2. How do I list all webjobs for my webapp and deployment slot
  3. How do I stop continuous webjob
  4. How do I set trigger to manual and remove schedule from scheduled webjobs

回答1:


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

  • WEBJOBS_STOPPED: 1
  • WEBJOBS_DISABLE_SCHEDULE: 1

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

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.



来源:https://stackoverflow.com/questions/50719134/how-to-stop-continuous-and-remove-schedule-from-schedules-web-jobs-in-vsts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!