-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStorage.bicep
42 lines (37 loc) · 1.26 KB
/
Storage.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
import * as types from 'types.bicep'
param keyVaultName string
param sqlSettings types.sqlSettingsType
param storageAccountSettings types.storageAccountSettingsType[]
param templateSettings types.templateSettingsType
var sqlServerName = 'sql-${templateSettings.sufix}-${templateSettings.env}'
var SqlDatabaseName = 'sql-${templateSettings.sufix}-${templateSettings.env}'
module storageAccountModules 'Modules/Storage/StorageAccountV2.bicep' = [for storageAccountSetting in storageAccountSettings: {
name: 'storageAccountModule-${storageAccountSetting.name}'
params: {
storageAccount: storageAccountSetting
env: templateSettings.env
keyVaultName: keyVaultName
location: templateSettings.location
}
}]
module SqlServerModule 'Modules/Sql/SqlServer.bicep' = {
name: 'sqlServerModule'
params: {
name: sqlServerName
sqlServerUsername: sqlSettings.sqlServerUsername
sqlServerPassword: sqlSettings.sqlServerPassword
location: templateSettings.location
}
}
module sqlDatabaseModule 'Modules/Sql/SqlServerDatabase.bicep' = {
name: 'sqlDatabaseModule'
dependsOn: [
SqlServerModule
]
params: {
name: SqlDatabaseName
databaseSettings: sqlSettings.database
sqlServerName: sqlServerName
location: templateSettings.location
}
}