-
Notifications
You must be signed in to change notification settings - Fork 27
/
main.bicep
51 lines (43 loc) · 1.17 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
targetScope = 'subscription'
param resPrefix string = 'chatr'
param resGroupName string = 'chatr'
param location string = 'westeurope'
// Required params
param githubRepo string
@secure()
param githubToken string
var storageName = '${resPrefix}store'
resource resGroup 'Microsoft.Resources/resourceGroups@2021-01-01' = {
name: resGroupName
location: location
}
module staticApp 'modules/static-webapp.bicep' = {
scope: resGroup
name: 'staticApp'
params: {
name: resPrefix
location: location
repoToken: githubToken
repoUrl: replace(githubRepo, '.git', '')
}
}
module storage 'modules/storage.bicep' = {
scope: resGroup
name: 'storage'
params: {
name: storageName
location: location
}
}
module pubsub 'modules/pubsub.bicep' = {
scope: resGroup
name: 'pubsub'
params: {
name: resPrefix
location: location
eventHandlerUrl: 'https://${staticApp.outputs.appHostname}/api/eventHandler'
}
}
output appUrl string = 'https://${staticApp.outputs.appHostname}'
output pubSubConnStr string = 'Endpoint=https://${resPrefix}.webpubsub.azure.com;AccessKey=${pubsub.outputs.key};Version=1.0;'
output storageKey string = storage.outputs.key