-
Notifications
You must be signed in to change notification settings - Fork 20
/
azure-main-live-test.bicep
72 lines (61 loc) · 1.93 KB
/
azure-main-live-test.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
//How To run:
// 1. Install Azure CLI https://docs.microsoft.com/en-us/cli/azure/install-azure-cli
// 2. az login
// 3. az account set -s <<your subscription id>>
// 5. az deployment sub what-if --resource-group southwind-rg --template-file azure-main-live-test.bicep
// 6. az deployment sub create --resource-group southwind-rg --template-file azure-main-live-test.bicep
targetScope = 'subscription'
param location string
param brodcastSecret string
param firewallMyIP string
param dbAdminPassword string
resource liveRG 'Microsoft.Resources/resourceGroups@2021-04-01' = {
name: 'southwind-live'
location: location
}
module containerReg 'azure-container-registry.bicep' = {
name: 'containerregistry'
scope: liveRG
params: {
location: location
}
}
module liveEnvironment 'azure-environment.bicep' = {
name: 'live'
params: {
suffix: 'live'
dbAdminUser: 'sa-southwind'
dbFirewallMyIp: firewallMyIP
dbAdminPassword: dbAdminPassword
usePostgressDatabase: false
location: location
containerRegistryName: containerReg.outputs.containerRegistryName
containerRegistryId: containerReg.outputs.containerRegistryId
imageName: 'southwind-live'
withSlot: true
brodcastSecret: brodcastSecret
}
scope: liveRG
}
resource testRG 'Microsoft.Resources/resourceGroups@2021-04-01' = {
name: 'southwind-test'
location: location
}
module testEnvironment 'azure-environment.bicep' = {
name: 'test'
params: {
suffix:'test'
dbAdminUser: 'sa-southwind'
dbFirewallMyIp: firewallMyIP
dbAdminPassword: dbAdminPassword
usePostgressDatabase: false
location: location
containerRegistryName: containerReg.outputs.containerRegistryName
containerRegistryId: containerReg.outputs.containerRegistryId
imageName: 'southwind-test'
withSlot: false
brodcastSecret: brodcastSecret
}
scope: testRG
}
output containerRegistryName string = containerReg.outputs.containerRegistryName