禁用触发的 Azure WebJob

编程入门 行业动态 更新时间:2024-10-20 06:27:26
本文介绍了禁用触发的 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 站点.有一种更高级的方法可以在 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

    本文发布于:2023-11-14 04:26:02,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1586213.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:Azure   WebJob

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!