Skip to content

Commit 36cd141

Browse files
Merge pull request #299215 from msangapu-msft/kudujobs
kudu migration
2 parents 1aa81d4 + 639b149 commit 36cd141

File tree

7 files changed

+253
-74
lines changed

7 files changed

+253
-74
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
author: msangapu-msft
3+
ms.service: azure-app-service
4+
ms.topic: include
5+
ms.date: 05/01/2025
6+
ms.author: msangapu
7+
---
8+
9+
### <a name="acceptablefiles"></a>Supported file types for scripts or programs
10+
11+
### [Windows code](#tab/windowscode)
12+
13+
The following file types are supported:
14+
15+
- Using Windows cmd: *.cmd*, *.bat*, *.exe*
16+
- Using PowerShell: *.ps1*
17+
- Using Bash: *.sh*
18+
- Using Node.js: *.js*
19+
- Using Java: *.jar*
20+
21+
The necessary runtimes to run these file types are already installed on the web app instance.
22+
23+
### [Windows container](#tab/windowscontainer)
24+
25+
The following file types are supported using Windows cmd: *.cmd*, *.bat*, *.exe*
26+
27+
In addition to these file types, WebJobs written in the language runtime of the Windows container app are supported.
28+
29+
- Example: *.jar* and *.war* scripts are supported if the container is a Java app.
30+
31+
### [Linux code](#tab/linuxcode)
32+
33+
*.sh* scripts are supported.
34+
35+
In addition to shell scripts, WebJobs written in the language of the selected runtime are also supported.
36+
37+
- Example: Python (*.py*) scripts are supported if the main site is a Python app.
38+
39+
### [Linux container](#tab/linuxcontainer)
40+
41+
*.sh* scripts are supported.
42+
43+
In addition to shell scripts, WebJobs written in the language runtime of the Linux container app are also supported.
44+
45+
- Example: Node (*.js*) scripts are supported if the site is a Node.js app.
46+
47+
---
133 KB
Loading

articles/app-service/overview-webjobs.md

Lines changed: 88 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,40 +3,107 @@ title: "App Service WebJobs Overview"
33
description: "An overview of Azure WebJobs, covering its types, supported platforms, file types, scheduling with NCRONTAB expressions, deployment options, and benefits for background processing within Azure App Service."
44
keywords: "Azure WebJobs, App Service, background processing, triggered jobs, continuous jobs, NCRONTAB, deployment, Azure, technical overview"
55
ms.topic: overview
6-
ms.date: 5/1/2025
6+
ms.date: 5/2/2025
77
author: msangapu-msft
88
ms.author: msangapu
99
ms.reviewer: ggailey
10-
#Customer intent: As a web developer, I want to leverage background tasks to keep my application running smoothly.
10+
ms.collection: ce-skilling-ai-copilot
11+
#Customer intent: I want to understand what WebJobs are, how they work with Azure App Service, and whether they’re the right solution for running background tasks in my app. I'm looking for guidance on supported platforms, types of jobs, deployment options, and how to get started or go deeper based on my use case.
1112
---
1213

1314
# App Service WebJobs overview
1415

15-
## Introduction
16-
Azure WebJobs is a built-in feature of Azure App Service that enables you to run background tasks, scripts, and programs alongside your web, API, or mobile applications without needing separate infrastructure. This integration simplifies the automation of routine or resource-intensive operations—such as data processing, file cleanups, or queue monitoring—by leveraging the same scalable, managed environment as your primary application.
16+
Azure WebJobs is a built-in feature of [Azure App Service](overview.md) that enables you to run background tasks, scripts, and programs alongside your web, API, or mobile applications. WebJobs simplify automation for common operations—such as data processing, image resizing, queue handling, or file cleanup—by running in the same scalable, managed environment as your application.
17+
18+
## Choosing WebJobs
19+
20+
WebJobs are a good fit when:
21+
- You're already hosting your application on App Service.
22+
- You want to deploy and manage background tasks together with your app.
23+
- You don't require a separate scaling model or event-based triggers beyond basic scheduling or queue polling.
24+
25+
For more scalable, independently hosted, or event-driven workloads, consider using [Azure Functions](../azure-functions/functions-overview.md).
26+
27+
## Key capabilities
28+
29+
- Run background tasks without provisioning separate infrastructure
30+
- Trigger jobs on demand, on a schedule, or continuously
31+
- Use multiple languages and scripting platforms
32+
- Deploy using the Azure portal, Visual Studio, zip deployment, or automation pipelines
33+
- Monitor and troubleshoot using Kudu or App Service diagnostics
34+
- Integrate with other Azure services such as Azure Storage, Event Hubs, or Service Bus
1735

1836
## WebJob types
19-
WebJobs come in two primary types:
20-
- **Triggered WebJobs:** Run on demand, on a schedule, or in response to specific events.
21-
- **Continuous WebJobs:** Operate perpetually, ensuring that critical background processes are always active.
2237

23-
For scheduled tasks, NCRONTAB expressions are used to define precise execution intervals, giving you fine-grained control over when the jobs run.
38+
WebJobs come in three main types:
39+
40+
- **Triggered WebJobs**: Run on demand or in response to specific events. You can trigger them manually or from a service like Azure Storage.
41+
- **Scheduled WebJobs**: A specialized type of triggered WebJob that runs on a defined schedule using a `settings.job` file with [NCRONTAB expressions](webjobs-create.md#ncrontab-expressions).
42+
- **Continuous WebJobs**: Run persistently in the background while your App Service app is running. Ideal for queue polling or background monitoring tasks.
43+
44+
45+
:::image type="content" border="false" source="media/overview-webjobs/webjob-types-app-service.png" alt-text="Diagram overview of WebJobs in Azure App Service, showing job types.":::
2446

2547
## Supported platforms and file types
26-
Azure WebJobs is fully supported on Windows code, Windows containers, Linux code, and Linux containers.
2748

28-
Supported file types include:
29-
- Windows command scripts (`.cmd`, `.bat`, `.exe`)
30-
- PowerShell scripts (`.ps1`)
31-
- Bash scripts (`.sh`)
32-
- Scripting languages such as Python (`.py`), PHP (`.php`), Node.js (`.js`), and F# (`.fsx`)
49+
WebJobs are supported on the following App Service hosting options:
50+
51+
- Windows code
52+
- Windows containers
53+
- Linux code
54+
- Linux containers
55+
56+
Supported file/script types include:
57+
58+
- Windows executables and scripts: `.exe`, `.cmd`, `.bat`
59+
- PowerShell scripts: `.ps1`
60+
- Bash scripts: `.sh`
61+
- Scripting languages: Python (`.py`), Node.js (`.js`), PHP (`.php`), F# (`.fsx`)
62+
- Any language runtime included in your container app
63+
64+
This versatility enables you to integrate WebJobs into a wide range of application architectures using the tools and languages you're already comfortable with.
65+
66+
## Deployment options
67+
68+
You can deploy WebJobs using several methods:
69+
70+
- **Azure portal or zip upload**: Manually upload your script or job files.
71+
- **Visual Studio**: Deploy directly with your ASP.NET app to Windows App Service.
72+
- **CI/CD pipelines**: Automate deployment with GitHub Actions, Azure DevOps, or Azure CLI.
73+
- **ARM/Bicep templates**: Deploy infrastructure and jobs declaratively.
74+
75+
WebJobs also provide **built-in logging** via Kudu and integration with App Service diagnostics to help you monitor job activity and troubleshoot issues.
76+
77+
## Scaling considerations
78+
79+
WebJobs scale together with your App Service plan. If your app is configured to scale out to multiple instances, your WebJobs will run on each instance as appropriate:
80+
- **Triggered WebJobs** will run on a single instance by default.
81+
- **Continuous WebJobs** can be configured to run on all instances or a single one using the `WEBJOBS_RUN_ONCE` setting.
82+
83+
If you need independently scalable or event-driven execution, [Azure Functions](../azure-functions/functions-overview.md) may be more appropriate.
84+
85+
## Best practices
86+
87+
- Use **triggered** WebJobs for ad hoc or scheduled operations.
88+
- Use **continuous** WebJobs only when the task needs to run constantly (e.g., polling a queue).
89+
- Implement **retry logic and error handling** within your scripts.
90+
- Use **application logging** and **Kudu logs** to monitor job behavior.
91+
- Keep job logic **separate from main app logic** when possible.
92+
- Use **storage-based triggers** (e.g., Azure Queues) for reliable, decoupled communication.
93+
94+
95+
## Choose your scenario
3396

34-
This versatility enables integration of WebJobs into a wide range of application architectures.
97+
| Goal | Article |
98+
|------|---------|
99+
| Quickly run a scheduled WebJob | [Quickstart: Create a scheduled WebJob](quickstart-webjobs.md) |
100+
| Build a WebJob manually using scripts or code | [Create a WebJob in Azure App Service](webjobs-create.md) |
101+
| Follow a tutorial using a practical use case | [Tutorial: Run background tasks with WebJobs](tutorial-webjobs.md) |
35102

36-
## Benefits and deployment
37-
By incorporating WebJobs into your App Service, you reduce operational overhead while gaining robust capabilities for background processing. Deployment options are flexible and include:
38-
- **Visual Studio Integration:** Seamlessly deploy WebJobs alongside your ASP.NET applications.
39-
- **Azure Portal and ZIP Deployment:** Easily upload and deploy your WebJob packages.
40-
- **Automated Pipelines:** Use ARM templates or Git for automated deployments.
103+
## <a name="NextSteps"></a> Next steps
41104

42-
Additionally, WebJobs provide built-in logging and monitoring, as well as seamless integration with other Azure services, making them a cost-effective and efficient solution for automating background tasks.
105+
- [Background jobs best practices – Azure Architecture Center](/azure/architecture/best-practices/background-jobs)
106+
- [Develop WebJobs using Visual Studio](webjobs-dotnet-deploy-vs.md)
107+
- [Get started with the WebJobs SDK](webjobs-sdk-get-started.md)
108+
- [Use the WebJobs SDK to build advanced jobs](webjobs-sdk-how-to.md)
109+
- [Kudu WebJobs reference on GitHub](https://github.com/projectkudu/kudu/wiki/WebJobs)

articles/app-service/quickstart-webjobs.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: 'Create a scheduled WebJob using a prebuilt script'
33
description: Quickly schedule a time-based WebJob in Azure App Service using a prebuilt script for Windows or Linux.
44
ms.topic: quickstart
5-
ms.date: 4/24/2025
5+
ms.date: 5/2/2025
66
author: msangapu-msft
77
ms.author: msangapu
88
ms.reviewer: glenga
@@ -22,7 +22,7 @@ WebJobs in Azure App Service let you run scripts or programs as background tasks
2222
- Enable **Always On** in the App Service settings: [Configure Always On](configure-common.md?tabs=portal#configure-general-settings)
2323
- For Windows containers and all Linux apps, set the app setting `WEBSITE_SKIP_RUNNING_KUDUAGENT = false`
2424

25-
## Step 1: Download a sample WebJob
25+
## Download a sample WebJob
2626

2727
Choose the version that matches your App Service OS:
2828

@@ -33,7 +33,7 @@ Choose the version that matches your App Service OS:
3333

3434
Each zip contains a single script that prints the current system date and time.
3535

36-
## Step 2: Add the WebJob in the Azure portal
36+
## Add the WebJob in the Azure portal
3737

3838
1. In the [Azure portal](https://portal.azure.com), go to your **App Service** app.
3939
2. In the left menu, select **WebJobs** > **+ Add**.
@@ -49,13 +49,13 @@ Each zip contains a single script that prints the current system date and time.
4949

5050
4. Select **OK** to create the WebJob.
5151

52-
## Step 3: Monitor WebJob logs
52+
## Verify the WebJob
5353

5454
1. Go to the **WebJobs** tab.
5555
2. Select your WebJob and open **Logs**.
5656
3. Confirm that it runs every minute and prints the system time.
5757

58-
## Step 4: Clean up
58+
## Clean up
5959

6060
To remove the WebJob, select the WebJob in the portal and select `Delete`.
6161

articles/app-service/toc.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -463,23 +463,27 @@ items:
463463
href: invoke-openapi-web-app-from-azure-ai-agent-service.md
464464
- name: WebJobs
465465
items:
466-
- name: Overview
467-
href: overview-webjobs.md
466+
- name: Overview
467+
href: overview-webjobs.md
468+
- name: Background jobs best practices
469+
href: /azure/architecture/best-practices/background-jobs?toc=/azure/app-service/toc.json&bc=/azure/app-service/breadcrumb/toc.json
468470
displayName: WebJobs overview
469471
- name: WebJobs Quickstart
470472
href: quickstart-webjobs.md
471473
displayName: Create a scheduled WebJob
472474
- name: WebJobs Tutorial
473-
href: tutorial-webjobs.md
474-
displayName: Prepare and schedule a WebJob
475-
- name: WebJobs How-to
475+
href: tutorial-webjobs.md
476+
displayName: Prepare and schedule a WebJob
477+
- name: How to create WebJobs
476478
href: webjobs-create.md
479+
- name: How WebJobs work
480+
href: webjobs-execution.md
477481
- name: Develop WebJobs using VS
478482
href: webjobs-dotnet-deploy-vs.md
479483
- name: Get started with WebJobs SDK
480484
href: webjobs-sdk-get-started.md
481485
- name: Use WebJobs SDK
482-
href: webjobs-sdk-how-to.md
486+
href: webjobs-sdk-how-to.md
483487
- name: Reliability
484488
items:
485489
- name: Reliability in Azure App Service

articles/app-service/webjobs-create.md

Lines changed: 3 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ description: Learn how to use WebJobs to run background tasks in Azure App Servi
44

55
ms.assetid: af01771e-54eb-4aea-af5f-f883ff39572b
66
ms.topic: concept-article
7+
ms.service: azure-app-service
78
ms.date: 4/17/2025
89
author: msangapu-msft
910
ms.author: msangapu
@@ -26,45 +27,7 @@ Azure Functions provides another way to run programs and scripts. For a comparis
2627

2728
## WebJob types
2829

29-
### <a name="acceptablefiles"></a>Supported file types for scripts or programs
30-
31-
### [Windows code](#tab/windowscode)
32-
33-
The following file types are supported:
34-
35-
- Using Windows cmd: *.cmd*, *.bat*, *.exe*
36-
- Using PowerShell: *.ps1*
37-
- Using Bash: *.sh*
38-
- Using Node.js: *.js*
39-
- Using Java: *.jar*
40-
41-
The necessary runtimes to run these file types are already installed on the web app instance.
42-
43-
### [Windows container](#tab/windowscontainer)
44-
45-
The following file types are supported using Windows cmd: *.cmd*, *.bat*, *.exe*
46-
47-
In addition to these file types, WebJobs written in the language runtime of the Windows container app are supported.
48-
49-
- Example: *.jar* and *.war* scripts are supported if the container is a Java app.
50-
51-
### [Linux code](#tab/linuxcode)
52-
53-
*.sh* scripts are supported.
54-
55-
In addition to shell scripts, WebJobs written in the language of the selected runtime are also supported.
56-
57-
- Example: Python (*.py*) scripts are supported if the main site is a Python app.
58-
59-
### [Linux container](#tab/linuxcontainer)
60-
61-
*.sh* scripts are supported.
62-
63-
In addition to shell scripts, WebJobs written in the language runtime of the Linux container app are also supported.
64-
65-
- Example: Node (*.js*) scripts are supported if the site is a Node.js app.
66-
67-
---
30+
[!INCLUDE [webjob-types](./includes/webjobs-create/webjob-types.md)]
6831

6932
### Continuous vs. triggered WebJobs
7033

@@ -79,8 +42,6 @@ The following table describes the differences between *continuous* and *triggere
7942

8043
[!INCLUDE [webjobs-always-on-note](../../includes/webjobs-always-on-note.md)]
8144

82-
83-
8445
## <a name="CreateContinuous"></a> Create a continuous WebJob
8546

8647
<!--
@@ -222,4 +183,4 @@ The following is a list of common WebJob states:
222183

223184
## <a name="NextSteps"></a> Next step
224185

225-
The Azure WebJobs SDK can be used with WebJobs to simplify many programming tasks. For more information, see [What is the WebJobs SDK](https://github.com/Azure/azure-webjobs-sdk/wiki).
186+
[Tutorial: Run background tasks with WebJobs](tutorial-webjobs.md)

0 commit comments

Comments
 (0)