You are designing a V4 Azure Function App that processes messages from an Azure Queue Storage queue. The Function App is hosted on a Consumption plan.
You have the following requirements:
1. Prevent a single Function App instance from processing more than messages concurrently to avoid memory exhaustion.
2. Prevent the Function App from scaling out to more than instances to avoid overloading a downstream database.
Which of the following configuration actions must you perform? (Select TWO)
- In the host.json file, configure the batchSize property to 8 under the extensions/queues section.Cevap
- Add an Application Setting named WEBSITE_MAX_DYNAMIC_APPLICATION_SCALE_OUT and set its value to 10.Cevap
- CAdd a property named functionAppScaleLimit with a value of 10 to the host.json file.
- DIn the trigger configuration of the function, set the batchSize parameter of the Queue trigger binding to 8.
Cevap
In the host.json file, configure the batchSize property to 8 under the extensions/queues section, and add an Application Setting named WEBSITE_MAX_DYNAMIC_APPLICATION_SCALE_OUT and set its value to 10.
To limit the concurrent message processing on a per-instance basis, you must modify the global host configuration. In Azure Functions, the batchSize property within the extensions/queues block of the host.json file defines how many messages an instance can pull and process concurrently. To limit the overall scale-out of the Function App, you configure the WEBSITE_MAX_DYNAMIC_APPLICATION_SCALE_OUT application setting, which tells the scale controller to cap instance allocation at the specified limit.
Adım Adım Çözüm
Anahtar Kavram
Azure Functions Concurrency and Scale-out Configuration