-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.bicep
146 lines (124 loc) · 4.24 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
// targetScope = 'subscription'
targetScope = 'resourceGroup'
// Parameters
param deploymentParams object
param identityParams object
param appConfigParams object
param storageAccountParams object
param logAnalyticsWorkspaceParams object
param funcParams object
param serviceBusParams object
param cosmosDbParams object
param brandTags object
param dateNow string = utcNow('yyyy-MM-dd-hh-mm')
param tags object = union(brandTags, {last_deployed:dateNow})
// Create Identity
module r_usr_mgd_identity 'modules/identity/create_usr_mgd_identity.bicep' = {
name: '${deploymentParams.enterprise_name_suffix}_${deploymentParams.global_uniqueness}_usr_mgd_identity'
params: {
deploymentParams:deploymentParams
identityParams:identityParams
tags: tags
}
}
//Create App Config
module r_app_config 'modules/app_config/create_app_config.bicep' = {
name: '${appConfigParams.appConfigNamePrefix}_${deploymentParams.global_uniqueness}_Config'
params: {
deploymentParams:deploymentParams
appConfigParams: appConfigParams
tags: tags
}
}
// Create Cosmos DB
module r_cosmodb 'modules/database/cosmos.bicep' ={
name: '${cosmosDbParams.cosmosDbNamePrefix}_${deploymentParams.global_uniqueness}_cosmos_db'
params: {
deploymentParams:deploymentParams
cosmosDbParams:cosmosDbParams
appConfigName: r_app_config.outputs.appConfigName
tags: tags
}
}
// Create the Log Analytics Workspace
module r_logAnalyticsWorkspace 'modules/monitor/log_analytics_workspace.bicep' = {
name: '${logAnalyticsWorkspaceParams.workspaceName}_${deploymentParams.global_uniqueness}_La'
params: {
deploymentParams:deploymentParams
logAnalyticsWorkspaceParams: logAnalyticsWorkspaceParams
tags: tags
}
}
// Create Storage Account
module r_sa 'modules/storage/create_storage_account.bicep' = {
name: '${storageAccountParams.storageAccountNamePrefix}_${deploymentParams.global_uniqueness}_Sa'
params: {
deploymentParams:deploymentParams
storageAccountParams:storageAccountParams
funcParams: funcParams
tags: tags
}
}
// Create Storage Account - Blob container
module r_blob 'modules/storage/create_blob.bicep' = {
name: '${storageAccountParams.storageAccountNamePrefix}_${deploymentParams.global_uniqueness}_Blob'
params: {
deploymentParams:deploymentParams
storageAccountParams:storageAccountParams
storageAccountName: r_sa.outputs.saName
storageAccountName_1: r_sa.outputs.saName_1
logAnalyticsWorkspaceId: r_logAnalyticsWorkspace.outputs.logAnalyticsPayGWorkspaceId
enableDiagnostics: false
}
dependsOn: [
r_sa
]
}
// Create the function app & Functions
module r_fn_app 'modules/functions/create_function.bicep' = {
name: '${funcParams.funcNamePrefix}_${deploymentParams.global_uniqueness}_Fn_App'
params: {
deploymentParams:deploymentParams
r_usr_mgd_identity_name: r_usr_mgd_identity.outputs.usr_mgd_identity_name
funcParams: funcParams
funcSaName: r_sa.outputs.saName_1
saName: r_sa.outputs.saName
blobContainerName: r_blob.outputs.blobContainerName
// appConfigName: r_appConfig.outputs.appConfigName
cosmos_db_accnt_name: r_cosmodb.outputs.cosmos_db_accnt_name
cosmos_db_name: r_cosmodb.outputs.cosmos_db_name
cosmos_db_container_name: r_cosmodb.outputs.cosmos_db_container_name
svc_bus_ns_name: r_svc_bus.outputs.svc_bus_ns_name
svc_bus_q_name: r_svc_bus.outputs.svc_bus_q_name
logAnalyticsWorkspaceId: r_logAnalyticsWorkspace.outputs.logAnalyticsPayGWorkspaceId
enableDiagnostics: true
tags: tags
}
dependsOn: [
r_sa
]
}
// Create the Service Bus & Queue
module r_svc_bus 'modules/integration/create_svc_bus.bicep' = {
// scope: resourceGroup(r_rg.name)
name: '${serviceBusParams.serviceBusNamePrefix}_${deploymentParams.global_uniqueness}_Svc_Bus'
params: {
deploymentParams:deploymentParams
serviceBusParams:serviceBusParams
tags: tags
}
}
/*
// Create Service Bus Subscription Filter
module r_svc_bus_sub_filter 'modules/integration/create_queue_subscription.bicep' = {
name: '${serviceBusParams.serviceBusNamePrefix}_${deploymentParams.global_uniqueness}_svc_bus_sub_filter'
params: {
deploymentParams:deploymentParams
serviceBusParams:serviceBusParams
tags: tags
}
dependsOn: [
r_svc_bus
]
}
*/