-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.bicep
70 lines (64 loc) · 1.57 KB
/
main.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
@description('The location in which all resources should be deployed.')
param location string = resourceGroup().location
@description('The name of the app to create.')
param appName string = uniqueString(resourceGroup().id)
var appServicePlanName = '${appName}${uniqueString(subscription().subscriptionId)}'
var vnetName = '${appName}vnet'
var vnetAddressPrefix = '10.0.0.0/16'
var subnetName = '${appName}sn'
var subnetAddressPrefix = '10.0.0.0/24'
var appServicePlanSku = 'S1'
resource appServicePlan 'Microsoft.Web/serverfarms@2020-06-01' = {
name: appServicePlanName
location: location
sku: {
name: appServicePlanSku
}
kind: 'app'
}
resource vnet 'Microsoft.Network/virtualNetworks@2020-06-01' = {
name: vnetName
location: location
properties: {
addressSpace: {
addressPrefixes: [
vnetAddressPrefix
]
}
subnets: [
{
name: subnetName
properties: {
addressPrefix: subnetAddressPrefix
delegations: [
{
name: 'delegation'
properties: {
serviceName: 'Microsoft.Web/serverFarms'
}
}
]
}
}
]
}
}
resource webApp 'Microsoft.Web/sites@2020-06-01' = {
name: appName
location: location
kind: 'app'
properties: {
serverFarmId: appServicePlan.id
}
dependsOn: [
vnet
]
}
resource webappVnet 'Microsoft.Web/sites/networkConfig@2020-06-01' = {
parent: webApp
name: 'virtualNetwork'
properties: {
subnetResourceId: vnet.properties.subnets[0].id
swiftSupported: true
}
}