Question

Difficulty: MediumConfigure Azure App Services

You host a web application on an Azure App Service web app named WebApp1 that runs on a Basic B1 App Service plan. You deploy a continuous background processing task to WebApp1 using Azure WebJobs. You observe that the WebJob stops executing shortly after you close your browser or when there is no active traffic to the web app. What should you do to ensure that the WebJob runs continuously without interruption?

  1. A
    Configure a custom autoscale rule on the Basic B1 App Service plan to maintain a minimum of two instances.
  2. B
    Enable the Always On setting in the configuration settings of the current Basic B1 App Service plan.
  3. Upgrade the App Service plan to the Standard S1 tier and enable the Always On setting.Answer
  4. D
    Configure a triggered WebJob with a CRON expression to run the background task every hour.

Answer

Upgrade the App Service plan to the Standard S1 tier and enable the Always On setting.
Upgrading the App Service plan to the Standard S1 tier allows you to enable the Always On setting. The Always On setting keeps the web app loaded in memory even when there is no active HTTP traffic, which is a prerequisite for continuous WebJobs to run properly.

Step-by-Step Solution

1
Analyze the behavior of continuous WebJobs under idle conditions.
Determine that the WebJob stops because the App Service unloads the application from memory when there is no active traffic.
Continuous WebJobs require the Always On setting to keep the application host process active.
2
Check the capability of the Basic B1 App Service plan regarding the Always On setting.
Identify that Always On is only supported on Standard or Premium tiers, and is unavailable in the Basic tier.
To use Always On, the hosting App Service plan must be scaled up to at least Standard S1.
3
Upgrade the App Service plan and configure the setting.
Upgrade to the Standard S1 tier and enable Always On under the Configuration settings of the Web App.
This keeps the web app loaded in memory indefinitely, allowing the continuous WebJob to run without interruption.

Key Concept

Enabling Always On for continuous WebJobs and App Service plan tier limits
Rate this question