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
+8-16Lines changed: 8 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,27 +32,19 @@ Inside the job folder, the Kudu engine looks for a file to execute. This file ca
32
32
33
33
## Entry point detection
34
34
35
-
The WebJob runtime looks for a file named `run.*` (such as `run.sh`, `run.py`, or `run.js`) as the entry point for the job. This allows you to control exactly what script or binary runs first, regardless of language or file type.
36
-
37
-
If a `run.*` file is not found, the platform falls back to executing the first valid script or binary it recognizes in the archive. This detection follows the order below:
38
-
39
-
-`run.cmd`
40
-
-`run.bat`
41
-
-`run.exe`
42
-
-`run.ps1`
43
-
-`run.sh`
44
-
-`run.py`
45
-
-`run.php`
46
-
-`run.js`
47
-
-`run.fsx`
35
+
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.
48
36
49
37
> [!NOTE]
50
-
> The file must be named exactly `run.*` to be recognized automatically—names like `start.sh` or `job.py` will not be treated as entry points.
38
+
> The filename must be exactly `run.*` to be auto-detected. Files like `start.sh` or `job.py` will be ignored unless manually triggered.
51
39
52
-
On Linux-based apps, `.sh` scripts must include a shebang (#!) and must have executable permissions.
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:
41
+
- A Python WebJob with multiple `.py` files (e.g., `file1.py`, `file2.py`) will execute the first `.py` file it finds in the archive.
42
+
- A Node.js WebJob will look for the first `.js` file.
43
+
- A Bash-based WebJob will look for the first `.sh` script.
53
44
54
-
To ensure consistent behavior across environments and avoid unpredictable results (especially when multiple script files are included), it’s strongly recommended to include a `run.*` file.
45
+
This fallback behavior can lead to **unpredictable execution**when multiple script files are present—especially in multi-file projects—so it's strongly recommended to include a `run.*` file to define the entry point explicitly.
55
46
47
+
On Linux-based WebJobs, `.sh` scripts must include a shebang (#!) and must be marked as executable.
0 commit comments