Question

Difficulty: EasyCreate and Configure Azure Functions

You are developing a lightweight Azure Function that runs once per day to prune expired user sessions from a database. The function takes approximately 30 seconds to run. You must minimize costs by only paying for the exact compute resource time that the function consumes. Which hosting plan should you select for the function app?

  1. Consumption planAnswer
  2. B
    Premium plan
  3. C
    Dedicated App Service plan
  4. D
    Durable Functions plan

Answer

The Consumption plan is the correct choice because it scales automatically and only charges for the time that the function executes, making it ideal for a lightweight daily task.
The Consumption plan is designed for serverless workloads where billing is based on resource consumption and execution count. For a function that runs only once per day for 30 seconds, this model ensures you only pay for those 30 seconds of compute time, minimizing total expenses.

Step-by-Step Solution

1
Analyze the workload requirements
The function runs sporadically (once per day) and has a short execution duration (30 seconds).
Understanding the workload pattern determines the most cost-efficient hosting model.
2
Compare hosting plan billing models
The Consumption plan charges only for execution time. The Premium and Dedicated plans charge continuously for allocated compute instances.
To satisfy the requirement to minimize costs and only pay when the function is running, a serverless billing model is required.
3
Select the correct hosting plan
Select the Consumption plan to achieve the lowest cost for this execution profile.
The Consumption plan aligns with the requirement of paying only for active compute time.

Key Concept

Azure Functions hosting plans and their billing models
Estimated Time:45s
Rate this question