nerdexam
Microsoft

AZ-204 · Question #222

You are developing an Azure function that connects to an Azure SQL Database instance. The function is triggered by an Azure Storage queue. You receive reports of numerous…

The correct answer is A. In the host.json file, decrease the value of the batchSize option. Switching to Premium seems a very bad idea. When the connections are unbounded, you will exceed the maximum sessions on the Azure SQL Database for sure when you don't scale that up too. The max concurrent sessions ranges between 300 (Basic) and 30.000 (Standard S9 or…

Submitted by devops_kid· Mar 30, 2026Monitor, troubleshoot, and optimize Azure solutions

Question

You are developing an Azure function that connects to an Azure SQL Database instance. The function is triggered by an Azure Storage queue. You receive reports of numerous System.InvalidOperationExceptions with the following message: "Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached." You need to prevent the exception. What should you do?

Options

  • AIn the host.json file, decrease the value of the batchSize option
  • BConvert the trigger to Azure Event Hub
  • CConvert the Azure Function to the Premium plan
  • DIn the function.json file, change the value of the type option to queueScaling

How the community answered

(20 responses)
  • A
    80% (16)
  • B
    10% (2)
  • C
    5% (1)
  • D
    5% (1)

Explanation

Switching to Premium seems a very bad idea. When the connections are unbounded, you will exceed the maximum sessions on the Azure SQL Database for sure when you don't scale that up too. The max concurrent sessions ranges between 300 (Basic) and 30.000 (Standard S9 or https://docs.microsoft.com/en-us/azure/azure-sql/database/resource-limits-dtu-single-databases

Topics

#Azure Functions#SQL connection pool#host.json#batch size tuning

Community Discussion

No community discussion yet for this question.

Full AZ-204 Practice