As mentioned here, it is possible to set the maximum number of host instances a function app is allowed to scale out to. That's great and we plan to use that, however both from that comment and from the docs it seems like that's supported only in Azure CLI (and ARM templates I am assuming).
We provision function apps on a consumption plan programmatically using the Microsoft.Azure.Management.ResourceManager SDK for .NET: as far as we've seen, there doesn't seem to be the possibility to set this property on creation.
The Microsoft.Azure.Management.ResourceManager SDK would include something like a .WithFunctionAppScaleLimit(int) API, similarly to the .WithHttpsOnly(bool) one (or the other ones for the apps' properties) for an easy set on creation.
Using the WEBSITE_MAX_DYNAMIC_APPLICATION_SCALE_OUT setting, which would be convenient to set programmatically and would be displayed in the portal just like any setting, but its usage is discouraged in the docs.
Our system needs to provision, apply settings, properties and deploy to function apps dynamically. All those apps run on Consumption plan and from package (WEBSITE_RUN_FROM_PACKAGE = 1)
The UI support in the portal has been implemented, very nice.
For setting the functionAppScaleLimit on the function apps we provision dynamically we ended up just issuing a PATCH request to the /config/web Azure Management API endpoint.
We also have a couple of other apps we provision with an ARM template from a release pipeline: for those, we couldn't find a way to set the functionAppScaleLimit in the template itself (didn't find any documentation that would suggest it would be possible), so we ended up running the documented Azure CLI command to set it. It would be handy if this property could be set from the ARM template.
Can you try using this
"type": "Microsoft.Web/sites",
"name": "[parameters('appService_name')]",
"apiVersion": "2018-11-01",
"location": "[parameters('appServicePlan_location')]",
"tags": {
},
"properties": {
"name": "[parameters('appService_name')]",
"siteConfig": {
"functionAppScaleLimit": 5
}
}
well, I've tried multiple combinations, but not that one: it works 馃槃 thank you @balag0
updated issue title and description according to new developments
Most helpful comment
well, I've tried multiple combinations, but not that one: it works 馃槃 thank you @balag0