how can i scalout function app (permium plan ) to 5 intances in arm template

Pranav Kumar Kazipeta 1 Reputation point
2021-07-13T19:37:20.283+00:00

WEBSITE_MAX_DYNAMIC_APPLICATION_SCALE_OUT : 5 is not working
az functionapp plan update -g $(resourceGroup) -n premiumplanname --max-burst 5
az resource update --resource-type Microsoft.Web/sites -g $(resourceGroup) -n functionappname/config/web --set properties.functionAppScaleLimit=4

above options are not working

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.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,185 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. MayankBargali-MSFT 70,726 Reputation points
    2021-07-15T05:14:41.977+00:00

    @Pranav Kumar Kazipeta Depending upon the api-version you are using in your ARM template you can either define the 'preWarmedInstanceCount' or 'reservedInstanceCount'. Please refer to siteconfig-object document for both for more details which settings are applied for which plan.

    Update 7/23 : Due to character limit in comment. I am updating my answer

    @Pranav Kumar Kazipeta For the plan scale out you need to configure the maximumElasticWorkerCount i.e. Maximum Burst and capacity as Minimum instance that you see in your screenshot. Please refer to Microsoft.Web/serverfarms ARM template document for more details and the sample QuickStart template

     {  
                    "type": "Microsoft.Web/serverfarms",  
                    "apiVersion": "2018-02-01",  
                    "name": "[parameters('serverfarms_ASP_maktest_b4eb_name')]",  
                    "location": "Central US",  
                    "sku": {  
                        "name": "EP1",  
                        "tier": "ElasticPremium",  
                        "size": "EP1",  
                        "family": "EP",  
                        "capacity": 5  
                    },  
                    "kind": "elastic",  
                    "properties": {  
                        "perSiteScaling": false,  
                        "maximumElasticWorkerCount": 15,  
                        "isSpot": false,  
                        "reserved": false,  
                        "isXenon": false,  
                        "hyperV": false,  
                        "targetWorkerCount": 0,  
                        "targetWorkerSizeId": 0  
                    }  
                }  
    

    For the App Scale Out as I mentioned earlier you need to need to define the preWarmedInstanceCount or reservedInstanceCount according to your api-version that you are specifying in your ARM template. The same reference document shared earlier have the sample ARM template and more details on the usage.
    In the below Microsoft.Web/sites/config I have configured the apiversion as 2018-11-01 therefore I am defining the reservedInstanceCount the same name App Scale Out "Always ready instance" in azure portal

            {  
                "type": "Microsoft.Web/sites/config",  
                "apiVersion": "2018-11-01",  
                "name": "[concat(parameters('sites_makcxtestarm_name'), '/web')]",  
                "location": "Central US",  
                "dependsOn": [  
                    "[resourceId('Microsoft.Web/sites', parameters('sites_makcxtestarm_name'))]"  
                ],  
                "properties": {  
                    "numberOfWorkers": 1,  
                    "defaultDocuments": [  
                        "Default.htm",  
                        "Default.html",  
                        "Default.asp",  
                        "index.htm",  
                        "index.html",  
                        "iisstart.htm",  
                        "default.aspx",  
                        "index.php"  
                    ],  
                    "netFrameworkVersion": "v4.0",  
                    "phpVersion": "5.6",  
                    "requestTracingEnabled": false,  
                    "remoteDebuggingEnabled": false,  
                    "httpLoggingEnabled": false,  
                    "logsDirectorySizeLimit": 35,  
                    "detailedErrorLoggingEnabled": false,  
                    "publishingUsername": "$makcxtestarm",  
                    "azureStorageAccounts": {},  
                    "scmType": "None",  
                    "use32BitWorkerProcess": true,  
                    "webSocketsEnabled": false,  
                    "alwaysOn": false,  
                    "managedPipelineMode": "Integrated",  
                    "virtualApplications": [  
                        {  
                            "virtualPath": "/",  
                            "physicalPath": "site\\wwwroot",  
                            "preloadEnabled": false  
                        }  
                    ],  
                    "loadBalancing": "LeastRequests",  
                    "experiments": {  
                        "rampUpRules": []  
                    },  
                    "autoHealEnabled": false,  
                    "localMySqlEnabled": false,  
                    "ipSecurityRestrictions": [  
                        {  
                            "ipAddress": "Any",  
                            "action": "Allow",  
                            "priority": 1,  
                            "name": "Allow all",  
                            "description": "Allow all access"  
                        }  
                    ],  
                    "scmIpSecurityRestrictions": [  
                        {  
                            "ipAddress": "Any",  
                            "action": "Allow",  
                            "priority": 1,  
                            "name": "Allow all",  
                            "description": "Allow all access"  
                        }  
                    ],  
                    "scmIpSecurityRestrictionsUseMain": false,  
                    "http20Enabled": false,  
                    "minTlsVersion": "1.2",  
                    "ftpsState": "AllAllowed",  
                    "reservedInstanceCount": 3  
                }  
            }  
    

    Feel free to get back to me if you need any assistance.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.