An organization deploys an Azure Function App (V4 runtime) on a Consumption plan. The function is triggered by an Azure Storage queue and processes incoming orders by writing them to an on-premises database via a Hybrid Connection. During peak hours, rapid scale-out of the Function App causes too many concurrent database connections, exceeding the database's connection limit. You need to restrict the maximum number of concurrent function app instances to 5 to protect the database, without changing the hosting plan or modifying the function code. Which configuration change should you implement?
- AConfigure the queues trigger settings in the host.json file by setting batchSize to 5.
- Add the application setting WEBSITE_MAX_DYNAMIC_APPLICATION_SCALE_OUT with a value of 5 in the Azure Portal.Answer
- CAdd the application setting WEBSITE_SCALE_LIMIT with a value of 5 in the Azure Portal.
- DMigrate the Function App to a Dedicated (App Service) plan and configure autoscale rules with a maximum instance count of 5.
Answer
Add the application setting WEBSITE_MAX_DYNAMIC_APPLICATION_SCALE_OUT with a value of 5 in the Azure Portal.
The setting WEBSITE_MAX_DYNAMIC_APPLICATION_SCALE_OUT limits the maximum number of instances that the scale controller can spin up for a function app on a Consumption or Premium plan. By setting this value to 5, the scaling logic is capped, preventing the function app from spawning more than 5 parallel instances and thereby limiting concurrent database connections.
Step-by-Step Solution
Key Concept
Azure Functions scale-out limits on dynamic hosting plans.
Estimated Time:1m 30s