azure webjob java_使用 WebJobs 运行后台任务 | Azure Docs

在 Azure 应用服务中使用 WebJobs 运行后台任务Run background tasks with WebJobs in Azure App Service

10/19/2020

本文内容

本文介绍如何使用 Azure 门户部署 WebJobs,以便上传可执行文件或脚本。This article shows how to deploy WebJobs by using the Azure portal to upload an executable or script. 有关如何使用 Visual Studio 开发和部署 WebJobs 的信息,请参阅使用 Visual Studio 部署 WebJobs。For information about how to develop and deploy WebJobs by using Visual Studio, see Deploy WebJobs using Visual Studio.

概述Overview

WebJobs 是 Azure 应用服务的一项功能,它允许你在与 Web 应用、API 应用或移动应用相同的实例中运行程序或脚本。WebJobs is a feature of Azure App Service that enables you to run a program or script in the same instance as a web app, API app, or mobile app. 使用 Web 作业无需支付额外的费用。There is no additional cost to use WebJobs.

重要

Linux 上的应用服务尚不支持 WebJobs。WebJobs is not yet supported for App Service on Linux.

可以结合 WebJobs 使用 Azure WebJobs SDK 来简化许多编程任务。The Azure WebJobs SDK can be used with WebJobs to simplify many programming tasks. For more information, see What is the WebJobs SDK.

Web 作业类型WebJob types

下表描述了 连续 和 触发 Web 作业之间的差别。The following table describes the differences between continuous and triggered WebJobs.

连续Continuous

触发Triggered

创建 Web 作业后立即启动。Starts immediately when the WebJob is created. 若要防止作业终止,程序或脚本通常在无限循环中执行其工作。To keep the job from ending, the program or script typically does its work inside an endless loop. 如果作业确实终止,可将其重启。If the job does end, you can restart it.

仅当手动触发或按计划触发时启动。Starts only when triggered manually or on a schedule.

在运行 Web 应用的所有实例上运行。Runs on all instances that the web app runs on. 可以选择性地将 Web 作业限制为单个实例。You can optionally restrict the WebJob to a single instance.

在 Azure 选择用于负载均衡的单个实例上运行。Runs on a single instance that Azure selects for load balancing.

支持远程调试。Supports remote debugging.

不支持远程调试。Doesn't support remote debugging.

备注

Web 应用可在进入非活动状态 20 分钟后超时。A web app can time out after 20 minutes of inactivity. 只有向实际 Web 应用发出的请求才会重置计时器。Only requests to the actual web app reset the timer. 在 Azure 门户中查看应用的配置或向高级工具站点 (https://.scm.chinacloudsites.cn) 发出请求不会重置计时器。Viewing the app's configuration in the Azure portal or making requests to the advanced tools site (https://.scm.chinacloudsites.cn) don't reset the timer. 如果应用运行连续性或计划的(计时器触发器)WebJobs,可启用 Always On 来确保 WebJobs 可靠运行。If your app runs continuous or scheduled (Timer trigger) WebJobs, enable Always On to ensure that the WebJobs run reliably. 此功能仅在基本、标准和高级定价层中提供。This

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值