Add WebJob to Azure App Service for Regular Triggering | Microsoft Azure

Configure WebJob Trigger Interval for Azure App Service

Question

You have an Azure App Service named WebApp1.

You plan to add a WebJob named WebJob1 to WebApp1.

You need to ensure that WebJob1 is triggered every 15 minutes.

What should you do?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

B

You can enter a CRON expression in the portal or include a settings.job file at the root of your WebJob .zip file, as in the following example:

{

"schedule": "0 */15 * * * *"

}

https://docs.microsoft.com/en-us/azure/app-service/webjobs-create

The correct answer is B. From the properties of WebJob1, change the CRON expression to 0*/15****.

Explanation:

WebJobs in Azure App Service are a feature that enables running background processes on the same infrastructure as your web app. They can be used for tasks such as continuous processing, periodic maintenance, or scheduled tasks. WebJobs can be triggered based on a CRON expression, which allows for scheduling the job to run at specific times or intervals.

To schedule a WebJob to run every 15 minutes, you can use a CRON expression of 0*/15****. This expression specifies that the job should run every 15 minutes, starting at the beginning of the hour (0 minutes).

Option A suggests changing the Web.config file to include the 1-31 1-12 1-7 0*/15* CRON expression. However, the Web.config file is used to configure settings for the web app itself, not for WebJobs.

Option C suggests adding a file named Settings.job to the ZIP file that contains the WebJob script and adding the CRON expression to the JOB file. This approach is valid for scheduling jobs on the local file system, but not for scheduling WebJobs in Azure App Service.

Option D suggests creating an Azure Automation account and adding a schedule to the account. This approach is valid for scheduling tasks in Azure Automation, but not for scheduling WebJobs in Azure App Service.

Therefore, the correct answer is B. From the properties of WebJob1, change the CRON expression to 0*/15****. This can be done in the Azure portal by navigating to the App Service that contains the WebJob, selecting the WebJob from the list of available WebJobs, and then configuring the CRON expression in the WebJob properties.