Skip to content

Commit 47c14ba

Browse files
Merge pull request #268298 from msangapu-msft/webjobs
Webjobs
2 parents fbc24da + 3734835 commit 47c14ba

File tree

1 file changed

+43
-20
lines changed

1 file changed

+43
-20
lines changed

articles/app-service/webjobs-create.md

Lines changed: 43 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ description: Learn how to use WebJobs to run background tasks in Azure App Servi
44

55
ms.assetid: af01771e-54eb-4aea-af5f-f883ff39572b
66
ms.topic: conceptual
7-
ms.date: 7/30/2023
7+
ms.date: 3/01/2024
88
author: msangapu-msft
99
ms.author: msangapu
10-
ms.reviewer: cephalin;suwatch;pbatum;naren.soni;glenga
10+
ms.reviewer: cephalin;suwatch;pbatum;naren.soni;
1111
adobe-target: true
1212
adobe-target-activity: DocsExp–386541–A/B–Enhanced-Readability-Quickstarts–2.19.2021
1313
adobe-target-experience: Experience B
@@ -17,21 +17,54 @@ adobe-target-content: ./webjobs-create-ieux
1717

1818
# Run background tasks with WebJobs in Azure App Service
1919

20+
> [!NOTE]
21+
> WebJobs for **Windows container**, **Linux code**, and **Linux container** is in preview. WebJobs for Windows code is generally available and not in preview.
22+
2023
Deploy WebJobs by using the [Azure portal](https://portal.azure.com) to upload an executable or script. You can run background tasks in the Azure App Service.
2124

2225
If instead of the Azure App Service, you're using Visual Studio to develop and deploy WebJobs, see [Deploy WebJobs using Visual Studio](webjobs-dotnet-deploy-vs.md).
2326

2427
## Overview
25-
WebJobs is a feature of [Azure App Service](index.yml) that enables you to run a program or script in the same instance as a web app, API app, or mobile app. There's no extra cost to use WebJobs.
28+
WebJobs is a feature of [Azure App Service](index.yml) that enables you to run a program or script in the same instance as a web app. There's no extra cost to use WebJobs.
2629

27-
You can use the Azure WebJobs SDK with WebJobs to simplify many programming tasks. WebJobs aren't supported for App Service on Linux yet. For more information, see [What is the WebJobs SDK](https://github.com/Azure/azure-webjobs-sdk/wiki).
30+
You can use the Azure WebJobs SDK with WebJobs to simplify many programming tasks. For more information, see [What is the WebJobs SDK](https://github.com/Azure/azure-webjobs-sdk/wiki).
2831

2932
Azure Functions provides another way to run programs and scripts. For a comparison between WebJobs and Functions, see [Choose between Flow, Logic Apps, Functions, and WebJobs](../azure-functions/functions-compare-logic-apps-ms-flow-webjobs.md).
3033

34+
35+
3136
## WebJob types
3237

33-
The following table describes the differences between *continuous* and *triggered* WebJobs.
38+
### <a name="acceptablefiles"></a>Supported file types for scripts or programs
39+
40+
### [Windows code](#tab/windowscode)
41+
The following file types are supported:<br>
42+
**.cmd**, **.bat**, **.exe** (using Windows cmd)<br>**.ps1** (using PowerShell)<br>**.sh** (using Bash)<br>**.php** (using PHP)<br>**.py** (using Python)<br>**.js** (using Node.js)<br>**.jar** (using Java)<br><br>The necessary runtimes to run these file types are already installed on the web app instance.
43+
### [Windows container](#tab/windowscontainer)
44+
> [!NOTE]
45+
> WebJobs for Windows container is in preview.
46+
>
47+
48+
The following file types are supported:<br>
49+
**.cmd**, **.bat**, **.exe** (using Windows cmd)<br><br>In addition to these file types, WebJobs written in the language runtime of the Windows container app.<br>Example: .jar and .war scripts if the container is a Java app.
50+
### [Linux code](#tab/linuxcode)
51+
> [!NOTE]
52+
> WebJobs for Linux code is in preview.
53+
>
54+
55+
**.sh** scripts are supported.<br><br>In addition to shell scripts, WebJobs written in the language of the selected runtime are also supported.<br>Example: Python (.py) scripts if the main site is a Python code app.
56+
### [Linux container](#tab/linuxcontainer)
57+
> [!NOTE]
58+
> WebJobs for Linux container is in preview.
59+
>
3460
61+
**.sh** scripts are supported. <br><br>In addition to shell scripts, WebJobs written in the language runtime of the Linux container app are also supported. <br>Example: Node (.js) scripts if the site is a Node.js app.
62+
63+
---
64+
65+
### Continuous vs. triggered WebJobs
66+
67+
The following table describes the differences between *continuous* and *triggered* WebJobs:
3568

3669
|Continuous |Triggered |
3770
|---------|---------|
@@ -42,17 +75,7 @@ The following table describes the differences between *continuous* and *triggere
4275

4376
[!INCLUDE [webjobs-always-on-note](../../includes/webjobs-always-on-note.md)]
4477

45-
## <a name="acceptablefiles"></a>Supported file types for scripts or programs
46-
47-
The following file types are supported:
4878

49-
* .cmd, .bat, .exe (using Windows cmd)
50-
* .ps1 (using PowerShell)
51-
* .sh (using Bash)
52-
* .php (using PHP)
53-
* .py (using Python)
54-
* .js (using Node.js)
55-
* .jar (using Java)
5679

5780
## <a name="CreateContinuous"></a> Create a continuous WebJob
5881

@@ -79,7 +102,7 @@ when making changes in one don't forget the other two.
79102
| **Name** | myContinuousWebJob | A name that is unique within an App Service app. Must start with a letter or a number and must not contain special characters other than "-" and "_". |
80103
| **File Upload** | ConsoleApp.zip | A *.zip* file that contains your executable or script file and any supporting files needed to run the program or script. The supported executable or script file types are listed in the [Supported file types](#acceptablefiles) section. |
81104
| **Type** | Continuous | The [WebJob types](#webjob-types) are described earlier in this article. |
82-
| **Scale** | Multi Instance | Available only for Continuous WebJobs. Determines whether the program or script runs on all instances or just one instance. The option to run on multiple instances doesn't apply to the Free or Shared [pricing tiers](https://azure.microsoft.com/pricing/details/app-service/?ref=microsoft.com&utm_source=microsoft.com&utm_medium=docs&utm_campaign=visualstudio). |
105+
| **Scale** | Multi Instance | Available only for Continuous WebJobs. Determines whether the program or script runs on all instances or one instance. The option to run on multiple instances doesn't apply to the Free or Shared [pricing tiers](https://azure.microsoft.com/pricing/details/app-service/?ref=microsoft.com&utm_source=microsoft.com&utm_medium=docs&utm_campaign=visualstudio). |
83106

84107
1. The new WebJob appears on the **WebJobs** page. If you see a message that says the WebJob was added, but you don't see it, select **Refresh**.
85108

@@ -166,7 +189,7 @@ To learn more, see [Scheduling a triggered WebJob](webjobs-dotnet-deploy-vs.md#s
166189

167190
## Manage WebJobs
168191

169-
You can manage the running state individual WebJobs running in your site in the [Azure portal](https://portal.azure.com). Just go to **Settings** > **WebJobs**, choose the WebJob, and you can start and stop the WebJob. You can also view and modify the password of the webhook that runs the WebJob.
192+
You can manage the running state individual WebJobs running in your site in the [Azure portal](https://portal.azure.com). Go to **Settings** > **WebJobs**, choose the WebJob, and you can start and stop the WebJob. You can also view and modify the password of the webhook that runs the WebJob.
170193

171194
You can also [add an application setting](configure-common.md#configure-app-settings) named `WEBJOBS_STOPPED` with a value of `1` to stop all WebJobs running on your site. You can use this method to prevent conflicting WebJobs from running both in staging and production slots. You can similarly use a value of `1` for the `WEBJOBS_DISABLE_SCHEDULE` setting to disable triggered WebJobs in the site or a staging slot. For slots, remember to enable the **Deployment slot setting** option so that the setting itself doesn't get swapped.
172195

@@ -184,14 +207,14 @@ You can also [add an application setting](configure-common.md#configure-app-sett
184207

185208
## WebJob statuses
186209

187-
Below is a list of common WebJob statuses:
210+
The following is a list of common WebJob statuses:
188211

189-
- **Initializing** The app has just started and the WebJob is going through its initialization process.
212+
- **Initializing** The app has started and the WebJob is going through its initialization process.
190213
- **Starting** The WebJob is starting up.
191214
- **Running** The WebJob is running.
192215
- **PendingRestart** A continuous WebJob exits in less than two minutes since it started for any reason, and App Service waits 60 seconds before restarting the WebJob. If the continuous WebJob exits after the two-minute mark, App Service doesn't wait the 60 seconds and restarts the WebJob immediately.
193216
- **Stopped** The WebJob was stopped (usually from the Azure portal) and is currently not running and won't run until you start it again manually, even for a continuous or scheduled WebJob.
194-
- **Aborted** This can occur for a number of reasons, such as when a long-running WebJob reaches the timeout marker.
217+
- **Aborted** This can occur for many of reasons, such as when a long-running WebJob reaches the timeout marker.
195218

196219
## <a name="NextSteps"></a> Next steps
197220

0 commit comments

Comments
 (0)