-
Notifications
You must be signed in to change notification settings - Fork 3
/
appservice.bicep
73 lines (70 loc) · 1.69 KB
/
appservice.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
param uniqueName string
param managedIdentityName string
param hostingPlanName string
@secure()
param appInsightsKey string
@secure()
param appInsightsConnectionString string
@secure()
param functionAppStorageConnectionString string
resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2018-11-30' existing={
name: managedIdentityName
}
resource appServicePlan 'Microsoft.Web/serverfarms@2021-02-01' = {
name: hostingPlanName
location: resourceGroup().location
kind: 'linux'
properties: {
targetWorkerCount: 1
reserved: true
}
sku: {
name: 'Y1'
tier: 'Dynamic'
}
}
resource PSfunctionApp 'Microsoft.Web/sites@2020-12-01' = {
name: 'function-${uniqueName}'
kind: 'functionapp,linux'
location: resourceGroup().location
identity: {
type: 'UserAssigned'
userAssignedIdentities: {
'${managedIdentity.id}': {}
}
}
properties: {
serverFarmId: appServicePlan.id
enabled: true
siteConfig: {
alwaysOn: false
appSettings: [
{
name: 'APPINSIGHTS_INSTRUMENTATIONKEY'
value: appInsightsKey
}
{
name: 'APPLICATIONINSIGHTS_CONNECTION_STRING'
value: appInsightsConnectionString
}
{
name: 'FUNCTIONS_EXTENSION_VERSION'
value: '~3'
}
{
name: 'FUNCTIONS_WORKER_RUNTIME'
value: 'powershell'
}
{
name: 'FUNCTIONS_WORKER_RUNTIME_VERSION'
value: '~7'
}
{
name: 'AzureWebJobsStorage'
value: 'DefaultEndpointsProtocol=${functionAppStorageConnectionString}'
}
]
}
keyVaultReferenceIdentity: managedIdentity.id
}
}