Skip to content

Commit

Permalink
feat: support FlexConsumption in serverfarm(Azure#3316)
Browse files Browse the repository at this point in the history
  • Loading branch information
pankajagrawal16 committed Oct 4, 2024
1 parent 02948b8 commit 4f2e323
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions avm/res/web/serverfarm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
4 changes: 3 additions & 1 deletion avm/res/web/serverfarm/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ param name string
'B1'
'P1v3'
'I1v2'
'FC1'
'''
})
param skuName string = 'P1v3'
Expand Down Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions avm/res/web/serverfarm/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down Expand Up @@ -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."
}
},
Expand Down Expand Up @@ -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')]",
Expand Down

0 comments on commit 4f2e323

Please sign in to comment.