我有一个由 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.
所以我的问题有两个:
如果我的问题的唯一解决方案是让 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 站点.有一种更高级的方法可以在 API 级别停止它,方法是在站点对象上设置 state=Stopped 和 scmSiteAlsoStopped=true.这可以使用资源浏览器完成.
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.
参见 github/projectkudu/kudu/wiki/Full-stopping-a-Web-App 了解更详细的步骤.
See github/projectkudu/kudu/wiki/Full-stopping-a-Web-App for more detailed steps.
更多推荐
禁用触发的 Azure WebJob
发布评论