-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.bicep
90 lines (76 loc) · 2.59 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
targetScope = 'subscription'
// Parameters
param deploymentParams object
param storageAccountParams object
param logAnalyticsWorkspaceParams object
param funcParams object
param brandTags object
var location = deploymentParams.location
var rgName = '${deploymentParams.enterprise_name}_${deploymentParams.enterprise_name_suffix}_${deploymentParams.global_uniqueness}'
param dateNow string = utcNow('yyyy-MM-dd-hh-mm')
param tags object = union(brandTags, {last_deployed:dateNow})
// Create Resource Group
module r_rg 'modules/resource_group/create_rg.bicep' = {
name: rgName
params: {
rgName: rgName
location: location
tags:tags
}
}
// Create the Log Analytics Workspace
module r_logAnalyticsWorkspace 'modules/monitor/log_analytics_workspace.bicep' = {
scope: resourceGroup(r_rg.name)
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' = {
scope: resourceGroup(r_rg.name)
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' = {
scope: resourceGroup(r_rg.name)
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_functionApp 'modules/functions/create_function.bicep' = {
scope: resourceGroup(r_rg.name)
name: '${storageAccountParams.storageAccountNamePrefix}_${deploymentParams.global_uniqueness}_FnApp'
params: {
deploymentParams:deploymentParams
funcParams: funcParams
saName: r_sa.outputs.saName
saName1: r_sa.outputs.saName_1
blobContainerName_1: r_blob.outputs.blobContainerName_1
// appConfigName: r_appConfig.outputs.appConfigName
logAnalyticsWorkspaceId: r_logAnalyticsWorkspace.outputs.logAnalyticsPayGWorkspaceId
enableDiagnostics: true
tags: tags
}
dependsOn: [
r_sa
]
}