Skip to content

Commit 8a889fd

Browse files
committed
asklearn updates
1 parent a482feb commit 8a889fd

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

articles/app-service/webjobs-execution.md

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,22 @@ You can customize WebJob behavior using an optional `settings.job` file (JSON fo
5454

5555
| Property | Description |
5656
|----------|-------------|
57-
| `is_singleton` | (bool) Ensures only one instance of the job runs across all scaled-out instances. Default: `true`. |
58-
| `stopping_wait_time` | (number, seconds) Grace period before the job is killed on shutdown. |
59-
| `shutdownGraceTimeLimit` | (number, seconds) Max time given for shutdown before process is forcefully terminated. |
60-
| `run_mode` | (string) Values: `continuous`, `scheduled`, `on_demand`. Overrides job type detection. |
57+
| `schedule` | (string) A CRON expression used to schedule a triggered job. Example: `"0 */15 * * * *"`. Only applicable to triggered jobs. |
58+
| `is_singleton` | (bool) Ensures only one instance of the job runs across all scaled-out instances. Default: `true` for continuous jobs, `false` for triggered/on-demand. |
59+
| `stopping_wait_time` | (number, seconds) Grace period (default 5s) given to the script before it's killed when the WebJob is stopped (e.g., during site swaps or restarts). |
60+
| `shutdownGraceTimeLimit` | (number, seconds) Max time (default 0s, meaning no limit) given for the entire WebJob process shutdown, including the `stopping_wait_time`, before it's forcefully terminated. |
61+
| `run_mode` | (string) Values: `continuous`, `scheduled`, `on_demand`. Overrides job type detection based on the folder. |
62+
63+
> [NOTE]
64+
> `stopping_wait_time` applies specifically to the running script's grace period, while `shutdownGraceTimeLimit` defines the overall process shutdown timeout. Consult the [Kudu documentation](https://github.com/projectkudu/kudu/wiki/WebJobs) for detailed behavior.
6165
6266
### Example
6367
```json
6468
{
69+
"schedule": "0 0 * * * *", // Run once at the top of every hour
6570
"is_singleton": true,
66-
"stopping_wait_time": 10,
67-
"shutdownGraceTimeLimit": 20,
68-
"run_mode": "scheduled"
71+
"stopping_wait_time": 60,
72+
"shutdownGraceTimeLimit": 120
6973
}
7074
```
7175

@@ -76,6 +80,7 @@ WebJob logs are handled by the Kudu engine and are available under the `App_Data
7680
```
7781
https://<your-app>.scm.azurewebsites.net/api/triggeredwebjobs/<job>/history
7882
```
83+
For more advanced monitoring and querying capabilities, consider integrating with [Application Insights](../../azure-monitor/app/app-insights-overview.md).
7984

8085
Triggered WebJobs include a full history of executions. Continuous WebJobs stream logs in real time.
8186

@@ -85,9 +90,11 @@ Triggered WebJobs include a full history of executions. Continuous WebJobs strea
8590

8691
## Troubleshooting tips
8792

88-
- **WebJob not starting:** Check for a missing or misnamed `run.*` file.
89-
- **Permissions error (Linux):** Ensure the script has execute permissions.
90-
- **Job not stopping gracefully:** Use `settings.job` to define shutdown grace period.
93+
- **WebJob not starting:** Check for a missing or misnamed `run.*` file. Ensure it's in the correct job folder (`triggered` or `continuous`).
94+
- **Permissions error (Linux):** Ensure the script has execute permissions (`chmod +x run.sh`) and includes a valid shebang (e.g., `#!/bin/bash`).
95+
- **Job not stopping gracefully:** Use `settings.job` to define `stopping_wait_time` and potentially `shutdownGraceTimeLimit`.
96+
- **Scheduled job not running:** Verify the CRON expression in `settings.job` is correct and the App Service Plan has "Always On" enabled if needed.
97+
- **Check Kudu logs:** Examine the detailed execution logs and deployment logs available in the Kudu console (`https://<your-app>.scm.azurewebsites.net/`) under Tools > WebJobs and potentially Log stream.
9198

9299
## See also
93100

0 commit comments

Comments
 (0)