below is the Arm Json that I am using to deploy the Consumption plan on Azure. Works perfectly. I want to how can we parameterize nested object in Arm:
{
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2022-03-01",
"name": "[variables('hostingPlanName')]",
"location": "[parameters('location')]",
"sku": {
"name": "Y1",
"tier": "Dynamic",
"size": "Y1",
"family": "Y",
"capacity": 0
},
"properties": {
"computeMode": "Dynamic"
}
}
For Example, If I want to parameterize sku property? It contains name, tier, size, family and capacity. I know how to parameterize each one separately for example:
"name": "[parameter('sku_name')]",
"tier": "[parameter('sku_tier')]"
But is it possible to parameterize the complete sku property in one go? Like:
"sku": "[parameter('sku')]"
But how it will be assigned in parameters section then?
CodePudding user response:
Based on the shared information I understand that you are trying to create consumption based function app using nested arm template.
But is it possible to parameterize the complete sku property in one go? Like: >"sku": "[parameter('sku')]"
Yes, you can create sku parameter of object type in your nested template and use it in Microsoft.Web/serverfarms
block in your main template.
To test this I have created a nested template to deploy consumption based plan and declared the sku properites block in parameters as shown below
Refer to this documentation for more information on How to use objects as parameters in your ARM templates.