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/quickstart-webjobs.md
+43-21Lines changed: 43 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,33 +1,68 @@
1
1
---
2
-
title: 'Quickstart: Create a scheduled WebJob'
2
+
title: 'Create a scheduled Python WebJob'
3
3
description: WebJobs on App Service enable you to automate repetitive tasks on your app. Learn how to create scheduled WebJobs in Azure App Service.
4
-
ms.topic: quickstart
5
-
ms.date: 8/21/2024
4
+
ms.topic: how-to
5
+
ms.date: 4/24/2025
6
6
author: msangapu-msft
7
7
ms.author: msangapu
8
8
ms.reviewer: glenga
9
-
zone_pivot_groups: app-service-webjobs
9
+
#zone_pivot_groups: app-service-webjobs
10
10
#Customer intent: As a web developer, I want to leverage a scheduled background task to keep my application running smoothly.
11
11
---
12
12
13
13
# Quickstart: Create a scheduled WebJob
14
14
15
-
In this quickstart, you create a scheduled WebJob to delete temporary files from a specified directory.
15
+
WebJobs is a feature of Azure App Service that enables you to run a program or script in the same instance as a web app. All app service plans support WebJobs. There's no extra cost to use WebJobs. This sample uses a Triggered (scheduled) WebJob to output the system time once every 15 minutes.
16
16
17
17
## Prerequisites
18
18
19
19
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?ref=microsoft.com&utm_source=microsoft.com&utm_medium=docs&utm_campaign=visualstudio).
20
-
- An App Service App on Linux. In this quickstart, [a Python app](quickstart-python.md) is used.
20
+
- An existing App Service app on Linux. In this quickstart, [a Python app](quickstart-python.md) is used.
21
21
-**[Always on](configure-common.md?tabs=portal)** must enabled on your app.
22
-
- App setting `WEBSITE_SKIP_RUNNING_KUDUAGENT`is set to `FALSE`.
22
+
- App setting `WEBSITE_SKIP_RUNNING_KUDUAGENT` set to `FALSE`.
23
23
24
-
## Create a scheduled WebJob
24
+
## Download the sample WebJob
25
25
26
26
:::zone target="docs" pivot="dotnet"
27
27
dotnet
28
28
:::zone-end
29
29
30
+
:::zone target="docs" pivot="node"
31
+
node
32
+
:::zone-end
33
+
34
+
:::zone target="docs" pivot="java"
35
+
java
36
+
:::zone-end
37
+
38
+
:::zone target="docs" pivot="php"
39
+
php
40
+
:::zone-end
41
+
30
42
:::zone target="docs" pivot="python"
43
+
[Download the sample project](https://github.com/Azure-Samples/App-Service-Python-WebJobs-QuickStart/archive/refs/heads/main.zip).
44
+
45
+
The sample Python WebJob is in `webjob.py`. It outputs the current time to the console as shown below:
The file, `run.sh`, calls WebJob.py as shown below:
55
+
56
+
```Bash
57
+
#!/bin/bash
58
+
/opt/python/3/bin/python3.13 webjob.py
59
+
```
60
+
61
+
The file, `run.sh` is included to show the capability of WebJobs. You can also omit the file and only include `webjob.py` in the .zip file.
62
+
63
+
:::zone-end
64
+
65
+
## Create a scheduled WebJob
31
66
32
67
1. In the [Azure portal](https://portal.azure.com), go to the **App Service** page of your App Service app.
33
68
@@ -54,19 +89,6 @@ dotnet
54
89
:::image type="content" source="media/webjobs-create/scheduled-webjob-run.png" alt-text="Screenshot that shows how to run a manually scheduled WebJob in the Azure portal.":::
0 commit comments