'Azure Functions bundle and extension, functions versions - javascript confusion 2.x, 5.0.x+?
I am making an azure cloudfunction with nodejs that gets triggered by a servicebus topic.
Reading this I am super confused, they have a version for everything and nothing makes sense in their documentation.
The host.json file has 2 versions, the schema version and the bundle range version. Then the article talks about 5.x+ version, but the default range is 3.3.0 to 4.0 but not including 4. I am very confused what version am I using, what binding options are available to me and none of the articles explain anything in a clear and concise manner.
{
"version": "2.0",
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[3.3.0, 4.0.0)"
}
}
Does this include 5.x+ that they talk about here? Do I need to make this 5.0.0?
If I use the host above, does this host.json config become invalid? The link above does not show messageHandlerOptions as one of the options (for 5.0.x) but mentions it being ok if not using sessions. Does it only apply for 2.0.x?
{
"version": "2.0",
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[3.3.0, 4.0.0)"
},
"extensions": {
"serviceBus": {
"prefetchCount": 1,
"messageHandlerOptions": {
"autoComplete": true,
"maxConcurrentCalls": 1,
"maxAutoRenewDuration": "00:09:30"
}
}
},
"functionTimeout": "00:09:55"
}
Solution 1:[1]
I believe that my answer (below) solves your confusion:

Then the article talks about 5.x+ version, but the default range is 3.3.0 to 4.0 but not including 4. I am very confused what version am I using, what binding options are available to me
I think, they have given clarity/information about which host.json version to use in C# Programming language and missed that info in other languages in the same documentation.
If you take a closer look by minimizing the documentation to certain extent, then this will provide the clarity on extension versions:
Explanation:
If you use the version 5.x or later of this extension Microsoft.Azure.WebJobs.Extensions.ServiceBus, then you can use the new configuration settings available in Extension 5.x+ in the host.json file.
If you use the version <5.x of this extension Microsoft.Azure.WebJobs.Extensions.ServiceBus, then can use the configurable settings available in Function 2.x+ in the host.json file.
What is the difference between Function and Extension?
AFAIK, they renamed the version name as Function 1.x, 2.x, Extension 5.x which are stable versions.
If I use the host above, does this host.json config become invalid? The link above does not show messageHandlerOptions as one of the options (for 5.0.x) but mentions it being ok if not using sessions. Does it only apply for 2.0.x?
As per my understanding - in the documentation, they have new configuration settings available of each version but the messageHandlerOptions is available in both the Function 2.x and Extension 5.x versions of the host.json file in Azure Functions Service Bus Trigger Bindings.
Updated Answer:
The MSFT Doc you have provided in the comment gives the details about Azure Functions Runtime Versions like 1.x, 2.x, 3.x and 4.x.
These are the Azure Functions Core Tools Versions required to run the specific language runtime programs.
For example:
JavaScript Versions (NodeJS 10, 12 & 14) works good with the Azure Functions Version 3.x whereas NodeJS version 16 works good with the Azure Functions Version 4.x.
This document also described the Migration steps and breaking changes of Azure Functions Runtime/Core Tools versions from old version to newer version.
Do I change the range in host.json to 5?
Every version of host.json i.e, Functions 1.x, Functions 2.x and Extension 5.x are same, they have incremented/discovered new configurable settings in each newer version.
I still don't understand the difference between function version and extension version. What version am I running?
Refer to Explanation Para in the same answer.
In a Simple, if you're using the extension Microsoft.Azure.WebJobs.Extensions.ServiceBus version is equal to 5.x or later, then you can use the settings available in Extensions 5.x+ block. If that ServiceBus extension version is less than 5.x, then use the configuration settings available in Functions 2.x for the host.json file.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |


