Configuring Azure WebJob Types for Web Apps | AZ-204 Exam

Azure WebJob Types for Web Apps

Question

Note: This question is part of a series of questions that present the same scenario.

Each question in the series contains a unique solution that might meet the stated goals.

Some question sets might have more than one correct solution, while others might not have a correct solution.

After you answer a question in this section, you will NOT be able to return to it.

As a result, these questions will not appear in the review screen.

You are designing an Azure WebJob that will run on the same instances as a web app.

You want to make use of a suitable WebJob type.

The webjob type should also allow for the option to restrict the WebJob to a single instance.

Solution: You configure the use of the Triggered WebJob type.

Does the solution meet the goal?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B.

B.

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

Yes, the solution meets the goal.

A WebJob in Azure is a background process that runs continuously or on a schedule alongside a web app. There are three types of WebJobs: Continuous, Triggered, and Scheduled.

The Continuous WebJob type runs continuously until it is manually stopped or encounters an error. It is useful for long-running processes such as a daemon or a listener.

The Triggered WebJob type runs on demand when triggered by an external event such as a message arriving on a queue or a file being uploaded to Azure Blob Storage.

The Scheduled WebJob type runs on a schedule, similar to a cron job, allowing you to run tasks at specific times or intervals.

In this scenario, the requirement is to run a WebJob that is hosted on the same instance as a web app and allows for the option to restrict the WebJob to a single instance. The Triggered WebJob type meets these requirements because it is a lightweight, on-demand WebJob that can be run on the same instance as a web app. Additionally, you can configure the Triggered WebJob type to run on a single instance by setting the WEBJOBS_DISABLE_SCHEDULE environment variable to "1" in the app settings of the web app hosting the WebJob. This ensures that the WebJob only runs on a single instance and is not duplicated across multiple instances, which can cause unexpected behavior.

Therefore, the solution of configuring the Triggered WebJob type meets the stated goals of the scenario.