Skip to content

Commit 29c1136

Browse files
committed
entry point
1 parent 2fefda1 commit 29c1136

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

articles/app-service/webjobs-execution.md

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,27 +32,19 @@ Inside the job folder, the Kudu engine looks for a file to execute. This file ca
3232

3333
## Entry point detection
3434

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.
4836

4937
> [!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.
5139
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.
5344

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.
5546

47+
On Linux-based WebJobs, `.sh` scripts must include a shebang (#!) and must be marked as executable.
5648

5749
## WebJob configuration with settings.job
5850

0 commit comments

Comments
 (0)