-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfunction-app.bicep
52 lines (49 loc) · 1.87 KB
/
function-app.bicep
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
@description('Name of the resource.')
param name string
@description('Location to deploy the resource. Defaults to the location of the resource group.')
param location string = resourceGroup().location
@description('Tags for the resource.')
param tags object = {}
@description('ID for the App Service Plan associated with the Function App.')
param appServicePlanId string
@description('App settings for the Function App.')
param appSettings array = []
@description('ID for the Managed Identity associated with the Function App.')
param identityId string
@description('Version of the runtime to use for the Function App. Defaults to .NET 8.0 Isolated.')
param linuxFxVersion string = 'DOTNET-ISOLATED|8.0'
@description('Public network access for the Function App. Defaults to Enabled.')
param publicNetworkAccess string = 'Enabled'
@description('Always On setting for the Function App. Defaults to false.')
param alwaysOn bool = false
resource functionApp 'Microsoft.Web/sites@2023-12-01' = {
name: name
location: location
tags: tags
kind: 'functionapp,linux'
identity: {
type: 'UserAssigned'
userAssignedIdentities: {
'${identityId}': {}
}
}
properties: {
serverFarmId: appServicePlanId
siteConfig: {
appSettings: appSettings
linuxFxVersion: linuxFxVersion
alwaysOn: alwaysOn
}
keyVaultReferenceIdentity: identityId
httpsOnly: true
publicNetworkAccess: publicNetworkAccess
}
}
@description('The deployed Function App resource.')
output resource resource = functionApp
@description('ID for the deployed Function App resource.')
output id string = functionApp.id
@description('Name for the deployed Function App resource.')
output name string = functionApp.name
@description('Host for the deployed Function App resource.')
output host string = functionApp.properties.defaultHostName