希望Azure Webjob在发布Web应用程序后保持运行状态(正在运行或已停止) [英] Want Azure webjobs to maintain running state (Running or Stopped) following publishing of web app

查看:104
本文介绍了希望Azure Webjob在发布Web应用程序后保持运行状态(正在运行或已停止)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Visual Studio 2015将Web应用程序和各种相关的(连续的)Webjob部署到Azure.直到最近,我的观察是,在部署过程之后,Webjob会保持其状态.如果作业正在运行,则如果更改了代码,它将重新启动.如果作业已停止,则代码将更新,并且网络作业将保持在已停止"状态.

I'm deploying a web application and various associated (continuous) webjobs to Azure using Visual Studio 2015. Until very recently my observation was that following the deployment process the webjobs would maintain their state; if the job was running, it would be restarted if the code was changed. If the job was Stopped, the code would update and the webjob would remain in the Stopped state.

我现在看到的行为是,已停止的Webjobs在部署后开始.这不是我想要的行为,因为作业由于某种原因而停止了.框架不应该将我发布Web应用程序代码和/或Webjob代码的新版本这一事实视为应该更改Webjobs的运行状态的假设.

The behavior I'm seeing now now is that the Stopped webjobs are starting following deployment. This is not the behavior I want, as the jobs are stopped for a reason. The fact that I'm publishing a new version of the web app code and/or webjob code shouldn't be seen as an assumption by the framework that the running state of the webjobs should be changed.

这种行为可控吗?

推荐答案

此处.

要在停止状态下部署连续的WebJob,只需在WebJob的根目录(二进制文件)中添加一个名为disable.job的文件,这将告诉框架WebJob当前已停止."

"To deploy a continuous WebJob in a stopped state simply add a file called disable.job at the root of your WebJob (binaries), this will tell the framework that the WebJob is currently stopped."

我快速搜索了Kudu回购,看来这仍然有效.但是,它实际上不在Kudu文档中.

I did a quick search of the Kudu repo, and it looks like this is still valid. It isn't actually in the Kudu docs though.

这篇关于希望Azure Webjob在发布Web应用程序后保持运行状态(正在运行或已停止)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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