Skip to content

Commit 4e60929

Browse files
committed
updates
1 parent 29d457a commit 4e60929

File tree

3 files changed

+98
-36
lines changed

3 files changed

+98
-36
lines changed
1.13 MB
Loading

articles/app-service/overview-webjobs.md

Lines changed: 92 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,47 +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](https://learn.microsoft.com/azure/azure-functions/functions-overview).
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](https://learn.microsoft.com/en-us/azure/app-service/webjobs-create#schedule-a-triggered-webjob).
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" source="media/overview-webjobs/webjob-types-app-service.png" alt-text="Overview of WebJobs in Azure App Service, showing job types." lightbox="media/overview-webjobs/webjob-types-app-service.png":::
2446

2547
## Supported platforms and file types
26-
Azure WebJobs is fully supported on Windows code, Windows containers, Linux code, and Linux containers.
27-
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`)
33-
- WebJobs written in the language runtime of the Windows/Linux container app.
34-
35-
This versatility enables integration of WebJobs into a wide range of application architectures.
36-
37-
## Benefits and deployment
38-
WebJobs provide a straightforward way to run background tasks as part of your App Service app, without needing separate infrastructure. They support various deployment methods depending on your workflow:
39-
40-
- Visual Studio: Supports direct deployment of WebJobs along with ASP.NET apps on Windows App Service.
41-
- Azure portal or ZIP upload: Upload a .zip package containing your script or executable and trigger configuration.
42-
- Automation tools: WebJobs can be deployed using ARM templates, Git, or CI/CD pipelines (like GitHub Actions or Azure DevOps).
43-
- Built-in logging and integration with Kudu make it easy to monitor execution and troubleshoot issues.
44-
- Additionally, WebJobs provide built-in logging and monitoring, as well as seamless integration with other Azure services, making them a practical solution for automating background tasks.
45-
46-
## <a name="NextSteps"></a> Next step
47-
[Create a scheduled WebJob](quickstart-webjobs.md).
48-
[Build a custom scheduled WebJob from scratch using .NET, Python, Node.js, Java, or PHP](tutorial-webjobs.md).
49-
[How to run background tasks with WebJobs](webjobs-create.md).
48+
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](https://learn.microsoft.com/azure/azure-functions/functions-overview) 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
96+
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) |
102+
103+
## Related guidance
104+
105+
- [Background jobs best practices – Azure Architecture Center](https://learn.microsoft.com/azure/architecture/best-practices/background-jobs)
106+
- [Develop WebJobs using Visual Studio](develop-webjobs-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/toc.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -464,18 +464,20 @@ items:
464464
- name: WebJobs
465465
items:
466466
- name: Overview
467-
href: overview-webjobs.md
467+
href: overview-webjobs.md
468+
- name: Background jobs best practices (Architecture Center)
469+
href: https://learn.microsoft.com/azure/architecture/best-practices/background-jobs
468470
displayName: WebJobs overview
469471
- name: WebJobs Quickstart
470472
href: quickstart-webjobs.md
471473
displayName: Create a scheduled WebJob
474+
- name: WebJobs Tutorial
475+
href: tutorial-webjobs.md
476+
displayName: Prepare and schedule a WebJob
472477
- name: How to create WebJobs
473478
href: webjobs-create.md
474479
- name: How WebJobs work
475480
href: webjobs-create.md
476-
- name: WebJobs Tutorial
477-
href: tutorial-webjobs.md
478-
displayName: Prepare and schedule a WebJob
479481
- name: Develop WebJobs using VS
480482
href: webjobs-dotnet-deploy-vs.md
481483
- name: Get started with WebJobs SDK

0 commit comments

Comments
 (0)