-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.bicep
57 lines (51 loc) · 1.51 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
@description('Relative DNS name for the traffic manager profile, resulting FQDN will be <uniqueDnsName>.trafficmanager.net, must be globally unique.')
param uniqueDnsName string
@description('Relative DNS name for the WebApps, must be globally unique. An index will be appended for each Web App.')
param uniqueDnsNameForWebApp string
@description('Name of the App Service Plan that is being created')
param appServicePlanName string
param location string = resourceGroup().location
@description('Name of the trafficManager being created')
param trafficManagerName string
resource appServicePlan 'Microsoft.Web/serverFarms@2020-12-01' = {
name: appServicePlanName
location: location
sku: {
name: 'S1'
tier: 'Standard'
}
}
resource webSite 'Microsoft.Web/sites@2020-12-01' = {
name: uniqueDnsNameForWebApp
location: location
properties: {
serverFarmId: appServicePlan.id
}
}
resource trafficManagerProfile 'Microsoft.Network/trafficManagerProfiles@2018-08-01' = {
name: trafficManagerName
location: 'global'
properties: {
profileStatus: 'Enabled'
trafficRoutingMethod: 'Priority'
dnsConfig: {
relativeName: uniqueDnsName
ttl: 30
}
monitorConfig: {
protocol: 'HTTPS'
port: 443
path: '/'
}
endpoints: [
{
name: uniqueDnsNameForWebApp
type: 'Microsoft.Network/trafficManagerProfiles/azureEndpoints'
properties: {
targetResourceId: webSite.id
endpointStatus: 'Enabled'
}
}
]
}
}