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/overview-webjobs.md
+88-21Lines changed: 88 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,40 +3,107 @@ title: "App Service WebJobs Overview"
3
3
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."
#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.
11
12
---
12
13
13
14
# App Service WebJobs overview
14
15
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
17
35
18
36
## 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.
22
37
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.":::
24
46
25
47
## Supported platforms and file types
26
-
Azure WebJobs is fully supported on Windows code, Windows containers, Linux code, and Linux containers.
27
48
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`
- 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
33
96
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)|
35
102
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
+
## <aname="NextSteps"></a> Next steps
41
104
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)
## <aname="CreateContinuous"></a> Create a continuous WebJob
85
46
86
47
<!--
@@ -222,4 +183,4 @@ The following is a list of common WebJob states:
222
183
223
184
## <aname="NextSteps"></a> Next step
224
185
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