HomeDev GuideRecipesAPI ReferenceGraphQL
Dev GuideAPI ReferenceUser GuideGitHubNuGetDev CommunityDoc feedbackLog In
GitHubNuGetDev CommunityDoc feedback


This feature is not supported with DXP for CMS 12 and Customized Commerce 14.

A WebJob is a feature of Azure App Service that lets you run arbitrary programs or scripts using the same App Service Plan resources as a Web App. You can run any script or console application with WebJobs that you can run on a Windows computer, with some functional limitations.

To run a WebJob, you need an existing Azure App Service Web App. You can run multiple WebJobs in a single App Service plan.


In DXP environments, the deployment flow only supports the **Continous** WebJob type.

A continuous WebJob starts when you deploy it and continues to run in an endless loop. For example, you can use this kind of WebJob to poll a message for new items and process their contents. Because the WebJob is continuous, your process can start quickly after the message appears.

## Create a WebJob project using Visual Studio

To create a WebJob that is deployed alongside an App Service Web App, use the WebJobs project template. Add this template to an existing Web App project by clicking the name of the Web App project. Click **Add** and then click **New Azure WebJob Project**.


A dialog box appears to choose options to create new WebJob.

The created project is a console application; it includes a _Program.cs_ file, which contains a **Main()** method that is entry point for the application. In the **Main()** method, the application initiates and configures a **JobHost** object, which is the object that communicates with Azure when the WebJob is deployed. You can place connection strings in _App.config_ and implement the logic that is executed in _Functions.cs_ file.

The project template also creates a _webjobs-list.json_ file in the Web App project:

The **filePath** points to the WebJob project where it also has an auto-generated JSON file called _webjob-publish-settings.json._

In the file, **runMode** is specified as **Continuous**.

After deploying the site to the DXP environment, the WebJob is located at _wwwroot\\app\_data\\jobs\\continuous._ 


An incorrect path causes the job to not work as expected.


See also blog post: [Adding WebJob to an existing CMS Web App](🔗) - Bien Le