You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Run background tasks with WebJobs in Azure App Service
19
19
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
+
20
23
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.
21
24
22
25
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).
23
26
24
27
## 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.
26
29
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).
28
31
29
32
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).
30
33
34
+
35
+
31
36
## WebJob types
32
37
33
-
The following table describes the differences between *continuous* and *triggered* WebJobs.
38
+
### <aname="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
+
>
34
60
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:
35
68
36
69
|Continuous |Triggered |
37
70
|---------|---------|
@@ -42,17 +75,7 @@ The following table describes the differences between *continuous* and *triggere
## <aname="acceptablefiles"></a>Supported file types for scripts or programs
46
-
47
-
The following file types are supported:
48
78
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)
56
79
57
80
## <aname="CreateContinuous"></a> Create a continuous WebJob
58
81
@@ -79,7 +102,7 @@ when making changes in one don't forget the other two.
79
102
|**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 "_". |
80
103
|**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. |
81
104
|**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). |
83
106
84
107
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**.
85
108
@@ -166,7 +189,7 @@ To learn more, see [Scheduling a triggered WebJob](webjobs-dotnet-deploy-vs.md#s
166
189
167
190
## Manage WebJobs
168
191
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.
170
193
171
194
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.
172
195
@@ -184,14 +207,14 @@ You can also [add an application setting](configure-common.md#configure-app-sett
184
207
185
208
## WebJob statuses
186
209
187
-
Below is a list of common WebJob statuses:
210
+
The following is a list of common WebJob statuses:
188
211
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.
190
213
-**Starting** The WebJob is starting up.
191
214
-**Running** The WebJob is running.
192
215
-**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.
193
216
-**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.
0 commit comments