-
Notifications
You must be signed in to change notification settings - Fork 0
/
main-complex.bicep
95 lines (87 loc) · 2.48 KB
/
main-complex.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
resource mySimpleAppServicePlan 'Microsoft.Web/serverfarms@2020-12-01' existing = {
name: 'mysimpleappserviceplan'
}
resource virtualNetwork 'Microsoft.Network/virtualNetworks@2021-02-01' existing = {
name: 'my-existing-vnet'
}
resource virtualNetworkSubnet 'Microsoft.Network/virtualNetworks/subnets@2021-02-01' existing = {
name: 'my-existing-subnet'
parent: virtualNetwork
}
resource myComplexStorageAccount 'Microsoft.Storage/storageAccounts@2021-06-01' = {
name: 'mycomplexstorageaccount'
location: resourceGroup().location
kind: 'StorageV2'
sku: {
name: 'Standard_LRS'
}
properties: {
supportsHttpsTrafficOnly: true
minimumTlsVersion: 'TLS1_2'
networkAcls: {
defaultAction: 'Deny'
virtualNetworkRules: [
{
id: virtualNetworkSubnet.id
}
]
}
}
}
var simpleStorageConnectionString = 'DefaultEndpointsProtocol=https;AccountName=${myComplexStorageAccount.name};EndpointSuffix=${environment().suffixes.storage};AccountKey=${listKeys(myComplexStorageAccount.id, myComplexStorageAccount.apiVersion).keys[0].value}'
resource myComplexFunctionApp 'Microsoft.Web/sites@2020-12-01' = {
name: 'mycomplexfunctionapp'
location: resourceGroup().location
kind: 'functionapp'
properties: {
httpsOnly: true
serverFarmId: mySimpleAppServicePlan.id
siteConfig: {
alwaysOn: true
vnetRouteAllEnabled: true
}
}
identity: {
type: 'SystemAssigned'
}
dependsOn: [
mySimpleAppServicePlan
myComplexStorageAccount
]
}
resource myComplexFunctionAppConfig 'Microsoft.Web/sites/config@2020-12-01' = {
name: 'mycomplexfunctionapp/appsettings'
properties: {
FUNCTIONS_EXTENSION_VERSION: '~3'
FUNCTIONS_WORKER_RUNTIME: 'dotnet'
AzureWebJobsStorage: simpleStorageConnectionString
}
dependsOn: [
myComplexFunctionApp
]
}
resource networkConfig 'Microsoft.Web/sites/networkConfig@2021-01-15' = {
parent: myComplexFunctionApp
name: 'virtualNetwork'
properties: {
subnetResourceId: resourceId(resourceGroup().id, 'Microsoft.Network/virtualNetworks/subnets', 'my-existing-vnet', 'my-existing-subnet')
}
dependsOn: [
myComplexFunctionApp
]
}
resource myComplexFunctionAppWebConfig 'Microsoft.Web/sites/config@2020-12-01' = {
name: 'mycomplexfunctionapp/web'
properties: {
ipSecurityRestrictions: {
ipAddress: 'Any'
action: 'Deny'
priority: 100
name: 'Deny All'
description: 'Deny All'
}
}
dependsOn: [
myComplexFunctionApp
]
}