禁用已触发的Azure WebJob [英] Disable a Triggered Azure WebJob
问题描述
我有一个通过Webhook触发的Azure WebJob.由于...原因,我无法控制正在发送Webhook的系统.每天发送一个webhook.这是由WebApp托管的唯一WebJob.
I've got a webhook-triggered Azure WebJob. For... reasons, I do not have control over the system that is sending the webhooks. One webhook per day is sent. It is the only WebJob hosted by the WebApp.
在测试期间,我想禁用此WebJob,因此我停止了WebApp.令我惊讶的是,即使WebApp被禁用,WebJob仍然运行.
During testing I wanted to disable this WebJob, so I stopped the WebApp. Much to my surprise, the WebJob ran even though the WebApp was disabled.
所以我的问题有两个:
- 是否有能力在禁用WebApp的情况下触发WebJob,还是我遇到了某种错误?
- 如果这是故意的,是否有办法禁用通过Azure门户触发的这项工作?
如果我的问题的唯一解决方案是让WebJob检查配置值以确定是否运行,则可以.我只是认为必须有一种方法可以通过我缺少的门户禁用WebJob.
If the only solution to my problem is to have the WebJob check a config value to determine whether to run or not, that will do. I just think there has to be a way to disable a WebJob through the portal that I'm missing.
推荐答案
停止应用程序不会停止运行WebJobs的scm站点.您可以通过在站点对象上设置state=Stopped
和scmSiteAlsoStopped=true
来在API级别上停止它,这是一种更高级的方法.可以使用资源浏览器完成此操作.
Stopping the app does not stop the scm site that runs WebJobs. There is a more advanced way that you can stop it at API level, by setting state=Stopped
and scmSiteAlsoStopped=true
on the site object. This can be done using Resource Explorer.
请参见 https://github.com/projectkudu/kudu/wiki/Full-stopping-a-Web-App 了解更多详细步骤.
See https://github.com/projectkudu/kudu/wiki/Full-stopping-a-Web-App for more detailed steps.
这篇关于禁用已触发的Azure WebJob的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!