Alex Gordon
Alex Gordon

Reputation: 60691

how to throttle the scale out of an azure function

I have a blob-triggered azure function. For each new file added to the storage account, the function gets triggered, like the following:

<Storage Account> --> Azure Function --> Remote Http Call

How do we limit the amount of concurrent Azure Functions that are spinned up?

Perhaps we should be doing queue-triggered or different-trigger?

Upvotes: 0

Views: 383

Answers (1)

Joy Wang
Joy Wang

Reputation: 42043

The blob trigger uses a queue internally, so the maximum number of concurrent function invocations is controlled by the queues configuration in host.json. The default settings limit concurrency to 24 invocations. This limit applies separately to each function that uses a blob trigger.

{
    "version": "2.0",
    "extensions": {
        "queues": {
            "maxPollingInterval": "00:00:02",
            "visibilityTimeout" : "00:00:30",
            "batchSize": 16,
            "maxDequeueCount": 5,
            "newBatchThreshold": 8
        }
    }
}

For more details, you could refer to this article.

Upvotes: 2

Related Questions