I have a function app which I where I want to prevent it from scaling out to more than one instance as the nature of the function means there are concurrency issues if it is allowed to scale out.
I've found very little in my research on this issue which is specific to consumption function apps. I know it is possible to do because I can set a scale out limit in Azure portal as shown in the below image. My function works exactly as intended with this option configured.
However, I want to configure this in my ARM template so that new deployments have this already set, but I cannot find anything in the ARM template which corresponds to this setting. I even tried exporting the template, then changing the Scale out configuration and exporting it again to compare the two templates, but there was no difference.
If anyone knows more about this or how I can possibly achieve the same thing another way it would be greatly appreciated.
You can set the WEBSITE_MAX_DYNAMIC_APPLICATION_SCALE_OUT
application setting to 1 (see documentation here).
In an ARM template, you can add application settings for a function like so:
{
"type": "Microsoft.Web/sites",
"apiVersion": "2018-11-01",
"name": "<functionname>",
"location": "<location>",
"dependsOn": [...],
"tags": {},
"kind": "functionapp,linux",
"identity": {
"type": "SystemAssigned"
},
"properties": {
"name": "<functionname>",
"siteConfig": {
"appSettings": [
{
"name": "WEBSITE_MAX_DYNAMIC_APPLICATION_SCALE_OUT",
"value": "1"
},
...
]
}
}
}