Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support function app flex consumption plan #3390

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
10 changes: 9 additions & 1 deletion avm/res/web/site/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ This module deploys a Web or Function App.
| `Microsoft.Web/sites/config` | [2022-09-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Web/sites) |
| `Microsoft.Web/sites/extensions` | [2023-12-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Web/sites/extensions) |
| `Microsoft.Web/sites/hybridConnectionNamespaces/relays` | [2022-09-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Web/2022-09-01/sites/hybridConnectionNamespaces/relays) |
| `Microsoft.Web/sites/slots` | [2022-09-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Web/2022-09-01/sites/slots) |
| `Microsoft.Web/sites/slots` | [2023-12-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Web/sites/slots) |
| `Microsoft.Web/sites/slots/basicPublishingCredentialsPolicies` | [2022-09-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Web/sites) |
| `Microsoft.Web/sites/slots/config` | [2022-09-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Web/sites) |
| `Microsoft.Web/sites/slots/hybridConnectionNamespaces/relays` | [2022-09-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Web/2022-09-01/sites/slots/hybridConnectionNamespaces/relays) |
Expand Down Expand Up @@ -2179,6 +2179,7 @@ module site 'br/public:avm/res/web/site:<version>' = {
| [`diagnosticSettings`](#parameter-diagnosticsettings) | array | The diagnostic settings of the service. |
| [`enabled`](#parameter-enabled) | bool | Setting this value to false disables the app (takes the app offline). |
| [`enableTelemetry`](#parameter-enabletelemetry) | bool | Enable/Disable usage telemetry for module. |
| [`functionAppConfig`](#parameter-functionappconfig) | object | The Function App configuration object. |
| [`hostNameSslStates`](#parameter-hostnamesslstates) | array | Hostname SSL states are used to manage the SSL bindings for app's hostnames. |
| [`httpsOnly`](#parameter-httpsonly) | bool | Configures a site to accept only HTTPS requests. Issues redirect for HTTP requests. |
| [`hybridConnectionRelays`](#parameter-hybridconnectionrelays) | array | Names of hybrid connection relays to connect app with. |
Expand Down Expand Up @@ -2508,6 +2509,13 @@ Enable/Disable usage telemetry for module.
- Type: bool
- Default: `True`

### Parameter: `functionAppConfig`

The Function App configuration object.

- Required: No
- Type: object

### Parameter: `hostNameSslStates`

Hostname SSL states are used to manage the SSL bindings for app's hostnames.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "5861139703409371797"
"version": "0.30.23.60470",
"templateHash": "2961784489694025029"
},
"name": "Web Site Basic Publishing Credentials Policies",
"description": "This module deploys a Web Site Basic Publishing Credentials Policy.",
Expand Down
4 changes: 2 additions & 2 deletions avm/res/web/site/config--appsettings/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "3998275265127709875"
"version": "0.30.23.60470",
"templateHash": "10845600494881775271"
},
"name": "Site App Settings",
"description": "This module deploys a Site App Setting.",
Expand Down
4 changes: 2 additions & 2 deletions avm/res/web/site/config--authsettingsv2/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "15126303852151434516"
"version": "0.30.23.60470",
"templateHash": "9901606105705730734"
},
"name": "Site Auth Settings V2 Config",
"description": "This module deploys a Site Auth Settings V2 Configuration.",
Expand Down
4 changes: 2 additions & 2 deletions avm/res/web/site/config--logs/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "1719886395722436280"
"version": "0.30.23.60470",
"templateHash": "5314244939846396394"
},
"name": "Site logs Config",
"description": "This module deploys a Site logs Configuration.",
Expand Down
4 changes: 2 additions & 2 deletions avm/res/web/site/config--web/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "7195763436259190781"
"version": "0.30.23.60470",
"templateHash": "4796843420829841335"
},
"name": "Site Api Management Config",
"description": "This module deploys a Site Api Management Configuration.",
Expand Down
4 changes: 2 additions & 2 deletions avm/res/web/site/extensions--msdeploy/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "2006653133597094766"
"version": "0.30.23.60470",
"templateHash": "8769701913978391000"
},
"name": "Site Deployment Extension ",
"description": "This module deploys a Site extension for MSDeploy.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "7661794789768148013"
"version": "0.30.23.60470",
"templateHash": "1833159536134902561"
},
"name": "Web/Function Apps Hybrid Connection Relay",
"description": "This module deploys a Site Hybrid Connection Namespace Relay.",
Expand Down
5 changes: 5 additions & 0 deletions avm/res/web/site/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ param siteConfig object = {
alwaysOn: true
}

@description('Optional. The Function App configuration object.')
param functionAppConfig object?

@description('Optional. Required if app of kind functionapp. Resource ID of the storage account to manage triggers and logging function executions.')
param storageAccountResourceId string?

Expand Down Expand Up @@ -265,6 +268,7 @@ resource app 'Microsoft.Web/sites@2023-12-01' = {
keyVaultReferenceIdentity: keyVaultAccessIdentityResourceId
virtualNetworkSubnetId: virtualNetworkSubnetId
siteConfig: siteConfig
functionAppConfig: functionAppConfig
clientCertEnabled: clientCertEnabled
clientCertExclusionPaths: clientCertExclusionPaths
clientCertMode: clientCertMode
Expand Down Expand Up @@ -352,6 +356,7 @@ module app_slots 'slot/main.bicep' = [
storageAccountRequired: slot.?storageAccountRequired ?? storageAccountRequired
virtualNetworkSubnetId: slot.?virtualNetworkSubnetId ?? virtualNetworkSubnetId
siteConfig: slot.?siteConfig ?? siteConfig
functionAppConfig: slot.?functionAppConfig ?? functionAppConfig
storageAccountResourceId: slot.?storageAccountResourceId ?? storageAccountResourceId
storageAccountUseIdentityAuthentication: slot.?storageAccountUseIdentityAuthentication ?? storageAccountUseIdentityAuthentication
appInsightResourceId: slot.?appInsightResourceId ?? appInsightResourceId
Expand Down
Loading