-
Notifications
You must be signed in to change notification settings - Fork 0
/
trafficsplitdemo.bicep
58 lines (53 loc) · 1.57 KB
/
trafficsplitdemo.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
@description('The name seed for all your other resources.')
param resNameSeed string = 'trafficSplitDemo'
@description('The short application name of the first Function App to receive 95% of the traffic')
param app1Name string = 'app1'
@description('The short application name of the first Function App to receive 95% of the traffic')
param app2Name string = 'app2'
@description('Creating the serverless app stack')
module app1 '../archetype/apimWebApp.bicep' = {
name: 'serverlessapp-${app1Name}'
params: {
resNameSeed: resNameSeed
appName: app1Name
AppGitRepoUrl: 'https://github.com/Gordonby/SimpleFunctionApp.git'
AppSettings: [
{
name: 'TRAFFICID'
value: app1Name
}
]
}
}
@description('Creating the serverless app stack')
module app2 '../archetype/apimWebApp.bicep' = {
name: 'serverlessapp-${app2Name}'
params: {
resNameSeed: resNameSeed
appName: app2Name
AppGitRepoUrl: 'https://github.com/Gordonby/SimpleFunctionApp.git'
AppSettings: [
{
name: 'TRAFFICID'
value: app2Name
}
]
}
dependsOn: [
app1
]
}
module apiConfig 'trafficsplitdemo-apiconfig.bicep' = {
name: 'apiconfig-${resNameSeed}'
params: {
apimLoggerId: app1.outputs.ApimLoggerId
apiBaseUrl: 'https://${app1.outputs.ApplicationUrl}'
apimName: app1.outputs.ApimName
resNameSeed: resNameSeed
appInsightsName: app1.outputs.AppInsightsName
apiOverrideUrl: 'https://${app2.outputs.ApplicationUrl}'
requireSubscriptionForApis: false
apiName: 'MyTrafficSplitApp'
apiOverrideWeight: 5
}
}