Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Functions host.json settings per function or global?

Do the settings in host.json apply to each function individually, or apply to all of the functions as a whole?

For example, I've two functions in the same Project that both get messages from Azure ServiceBus Queues.

If I set maxConcurrentCalls to 10 in host.json, does that mean that as a whole only 10 concurrent calls to ServiceBus will be made, or that it is 10 per function, so there will be 20 concurrent calls?

Thanks in advance.

like image 436
DavidGouge Avatar asked Jun 08 '17 09:06

DavidGouge


People also ask

What is host json in Azure Functions?

The host. json metadata file contains configuration options that affect all functions in a function app instance. This article lists the settings that are available starting with version 2. x of the Azure Functions runtime. Note.

Can a function app have multiple Functions Azure?

Organize your functions As part of your solution, you likely develop and publish multiple functions. These functions are often combined into a single function app, but they can also run in separate function apps.

How many hosting plans do Azure Functions have?

There are three basic hosting plans available for Azure Functions: Consumption plan, Premium plan, and Dedicated (App Service) plan.


1 Answers

host.json file is shared for all functions of a FunctionApp. That's to say that maxConcurrentCalls value will apply to all functions of the app, as any other setting will.

The effect of maxConcurrentCalls will be independent for each function. In your example, each function will have up to 10 messages processed concurrently. If you set it to 1, there will be 1 thread working per function.

Note that maxConcurrentCalls applies per instance. If you have multiple instances running, the max concurrency increases proportionally.

like image 85
Mikhail Shilkov Avatar answered Oct 05 '22 22:10

Mikhail Shilkov