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
Copy file name to clipboardExpand all lines: articles/app-service/webjobs-execution.md
+14-9Lines changed: 14 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,14 +6,26 @@ ms.service: azure-app-service
6
6
author: msangapu-msft
7
7
ms.author: msangapu
8
8
ms.date: 05/01/2025
9
+
ms.collection: ce-skilling-ai-copilot
9
10
---
10
11
11
12
# How WebJobs run in Azure App Service
12
13
13
-
Azure WebJobs allow you to run background tasks within your App Service app, without needing separate infrastructure. These tasks are discovered and managed by the **Kudu engine**, which handles execution, monitoring, and log collection.
14
+
Azure WebJobs allow you to run background tasks within your App Service app, without needing separate infrastructure. These tasks are discovered and managed by the Kudu engine, the built-in App Service deployment and runtime management service. Kudu handles WebJob execution, file system access, diagnostics, and log collection behind the scenes.
14
15
15
16
This article explains how WebJobs are discovered, how the runtime decides what to execute, and how you can configure behavior using the optional `settings.job` file.
16
17
18
+
## Platform-specific notes
19
+
20
+
WebJobs support a variety of script and executable formats, depending on the App Service hosting environment. The types of files you can run—and the runtimes available—vary slightly based on whether you're using Windows code, Linux code, or custom containers. In general, built-in runtimes are available for common scripting languages, and additional file types are supported when they match the language runtime of your app or container.
> WebJobs that are continuous, scheduled, or event-driven may stop running if the web app hosting them becomes idle. Web apps can time out after 20 minutes of inactivity, and only direct requests to the app reset this idle timer. Actions like viewing the portal or accessing the Kudu tools do not keep the app active.
26
+
> To ensure WebJobs run reliably, enable the Always on setting in the Configuration pane of your App Service.
27
+
> This setting is available only in the Basic, Standard, and Premium pricing tiers.
28
+
17
29
## Job discovery and folder structure
18
30
19
31
WebJobs are stored in the `site/wwwroot/App_Data/jobs/` folder of your App Service app. There are two subfolders:
@@ -34,10 +46,7 @@ Inside the job folder, the Kudu engine looks for a file to execute. This file ca
34
46
35
47
The WebJobs runtime uses a file named `run.*` (such as `run.py`, `run.sh`, or `run.js`) as the explicit entry point for a job. This file tells the platform which script or binary to execute first, ensuring consistent and predictable behavior across environments.
36
48
37
-
> [!NOTE]
38
-
> The filename must be exactly `run.*` to be autodetected. Files like `start.sh` or `job.py` will be ignored unless manually triggered.
39
-
40
-
If no `run.*` file is found, the platform attempts to detect a fallback entry point by selecting the first supported file based on the language platform of the WebJob. For example:
49
+
The filename must be exactly `run.*` to be autodetected. Files like `start.sh` or `job.py` will be ignored unless manually triggered. If no `run.*` file is found, the platform attempts to detect a fallback entry point by selecting the first supported file based on the language platform of the WebJob. For example:
41
50
- A Python WebJob with multiple `.py` files (for example, `file1.py`, `file2.py`) will execute the first `.py` file it finds in the archive.
42
51
- A Node.js WebJob looks for the first `.js` file.
43
52
- A Bash-based WebJob looks for the first `.sh` script.
@@ -82,10 +91,6 @@ For more advanced monitoring and querying capabilities, consider integrating wit
82
91
83
92
Triggered WebJobs include a full history of executions. Continuous WebJobs stream logs in real time.
0 commit comments