Skip to content

Commit d513260

Browse files
committed
updates
1 parent f4546f5 commit d513260

File tree

2 files changed

+45
-26
lines changed

2 files changed

+45
-26
lines changed

articles/app-service/quickstart-webjobs.md

Lines changed: 43 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,68 @@
11
---
2-
title: 'Quickstart: Create a scheduled WebJob'
2+
title: 'Create a scheduled Python WebJob'
33
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
66
author: msangapu-msft
77
ms.author: msangapu
88
ms.reviewer: glenga
9-
zone_pivot_groups: app-service-webjobs
9+
#zone_pivot_groups: app-service-webjobs
1010
#Customer intent: As a web developer, I want to leverage a scheduled background task to keep my application running smoothly.
1111
---
1212

1313
# Quickstart: Create a scheduled WebJob
1414

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

1717
## Prerequisites
1818

1919
- 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.
2121
- **[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`.
2323

24-
## Create a scheduled WebJob
24+
## Download the sample WebJob
2525

2626
:::zone target="docs" pivot="dotnet"
2727
dotnet
2828
:::zone-end
2929

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+
3042
:::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:
46+
47+
```Python
48+
import datetime
49+
50+
current_datetime = datetime.datetime.now()
51+
print(current_datetime) # Output: 2025-03-27 10:27:21.240752
52+
```
53+
54+
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
3166

3267
1. In the [Azure portal](https://portal.azure.com), go to the **App Service** page of your App Service app.
3368

@@ -54,19 +89,6 @@ dotnet
5489
:::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.":::
5590

5691
[!INCLUDE [webjobs-cron-timezone-note](../../includes/webjobs-cron-timezone-note.md)]
57-
:::zone-end
58-
59-
:::zone target="docs" pivot="node"
60-
node
61-
:::zone-end
62-
63-
:::zone target="docs" pivot="java"
64-
java
65-
:::zone-end
66-
67-
:::zone target="docs" pivot="php"
68-
php
69-
:::zone-end
7092

7193
## <a name="NextSteps"></a> Next steps
7294

articles/app-service/webjobs-create.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,8 @@ ms.topic: conceptual
77
ms.date: 3/01/2024
88
author: msangapu-msft
99
ms.author: msangapu
10-
ms.reviewer: cephalin;suwatch;pbatum;naren.soni;
11-
adobe-target: true
12-
adobe-target-activity: DocsExp–386541–A/B–Enhanced-Readability-Quickstarts–2.19.2021
13-
adobe-target-experience: Experience B
14-
adobe-target-content: ./webjobs-create-ieux
10+
ms.reviewer: glenga;suwatch;pbatum;naren.soni;
11+
1512
#Customer intent: As a web developer, I want to leverage background tasks to keep my application running smoothly.
1613
---
1714

0 commit comments

Comments
 (0)