From 4f2e323b0f532b9101fb1eb947ba99fc56e6ae58 Mon Sep 17 00:00:00 2001 From: pankajagrawal Date: Fri, 4 Oct 2024 10:22:27 +0200 Subject: [PATCH] feat: support FlexConsumption in serverfarm(#3316) --- avm/res/web/serverfarm/README.md | 1 + avm/res/web/serverfarm/main.bicep | 4 +++- avm/res/web/serverfarm/main.json | 9 +++++---- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/avm/res/web/serverfarm/README.md b/avm/res/web/serverfarm/README.md index 152351ffe2..c6dcb40d11 100644 --- a/avm/res/web/serverfarm/README.md +++ b/avm/res/web/serverfarm/README.md @@ -731,6 +731,7 @@ The name of the SKU will Determine the tier, size, family of the App Service Pla 'B1' 'P1v3' 'I1v2' + 'FC1' ``` ### Parameter: `tags` diff --git a/avm/res/web/serverfarm/main.bicep b/avm/res/web/serverfarm/main.bicep index a9dc015538..3d04b2f664 100644 --- a/avm/res/web/serverfarm/main.bicep +++ b/avm/res/web/serverfarm/main.bicep @@ -14,6 +14,7 @@ param name string 'B1' 'P1v3' 'I1v2' + 'FC1' ''' }) param skuName string = 'P1v3' @@ -129,7 +130,8 @@ resource appServicePlan 'Microsoft.Web/serverfarms@2022-09-01' = { tags: tags sku: { name: skuName - capacity: skuCapacity + capacity: skuName == 'FC1' ? null : skuCapacity + tier: skuName == 'FC1' ? 'FlexConsumption' : null } properties: { workerTierName: workerTierName diff --git a/avm/res/web/serverfarm/main.json b/avm/res/web/serverfarm/main.json index ba4108ee0b..e6d8dd5be3 100644 --- a/avm/res/web/serverfarm/main.json +++ b/avm/res/web/serverfarm/main.json @@ -5,8 +5,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.30.3.12046", - "templateHash": "12599229174633311842" + "version": "0.30.23.60470", + "templateHash": "489102920669919211" }, "name": "App Service Plan", "description": "This module deploys an App Service Plan.", @@ -205,7 +205,7 @@ "type": "string", "defaultValue": "P1v3", "metadata": { - "example": " 'F1'\n 'B1'\n 'P1v3'\n 'I1v2'\n ", + "example": " 'F1'\n 'B1'\n 'P1v3'\n 'I1v2'\n 'FC1'\n ", "description": "Optional. The name of the SKU will Determine the tier, size, family of the App Service Plan. This defaults to P1v3 to leverage availability zones." } }, @@ -379,7 +379,8 @@ "tags": "[parameters('tags')]", "sku": { "name": "[parameters('skuName')]", - "capacity": "[parameters('skuCapacity')]" + "capacity": "[if(equals(parameters('skuName'), 'FC1'), null(), parameters('skuCapacity'))]", + "tier": "[if(equals(parameters('skuName'), 'FC1'), 'FlexConsumption', null())]" }, "properties": { "workerTierName": "[parameters('workerTierName')]",