Microsoft Certified: Azure Developer Associate (AZ-204)Develop Azure compute solutionsHard

A developer is configuring an Azure Function with an HTTP trigger. The function needs to accept JSON payloads up to 10 MB in size. The default timeout for HTTP-triggered functions in a Consumption plan is 5 minutes. The processing logic for some payloads might take up to 7 minutes due to complex calculations. Which configuration change is MOST critical to ensure the function completes successfully?

  1. AImplement a durable function pattern.
  2. BAdjust the host.json timeout setting.
  3. CChange the App Service Plan to Premium.
  4. DIncrease the function app's memory limit.
Show answer & explanation

Correct answer: C. Change the App Service Plan to Premium.

Azure Functions in a Consumption plan have a default timeout of 5 minutes (extendable to 10 minutes with `host.json`). For operations exceeding this, particularly up to 7 minutes, moving to a Premium plan is the most direct solution as it allows for an unlimited execution duration for HTTP triggered functions, provided the host is responsive.

Why the other options are wrong

  • A. Implementing a durable function pattern would involve re-architecting the function to handle long-running operations asynchronously, which is a valid solution but not a 'configuration change' and might be overkill if a simple plan change suffices.
  • B. Adjusting `host.json` can extend the timeout up to 10 minutes (600 seconds) in a Consumption plan, which is insufficient for a 7-minute (420 seconds) process if the default is 5 minutes (300 seconds) and the requirement is 7 minutes. The default for Consumption is 5 min, max is 10 min. 7 minutes is within 10 minutes, but it's not the 'most critical' if the problem implies exceeding consumption capabilities. The question states 'up to 7 minutes', which is within the 10 min limit of consumption plan via `host.json`. However, 'MOST critical' for reliability when 'some payloads might take up to 7 minutes' means you need to guarantee that. Premium offers unlimited duration, making it more robust.
  • D. Increasing memory limit might help with processing large payloads, but it won't address the 5-minute timeout for HTTP triggers in a Consumption plan.

Azure Functions Timeouts

The maximum duration an Azure Function can execute before being terminated.

  • Consumption plan: 5 min default, 10 min max (configurable)
  • Premium plan: Unlimited duration (host responsive)
  • Dedicated/App Service plan: Default 30 min, configurable up to App Service plan timeout (230s default for HTTP, configurable up to 30min).
  • Timeouts vary by hosting plan and trigger type.

Memory trick: Plan Defines Time, Premium is Forever

More Develop Azure compute solutions questions