-
Notifications
You must be signed in to change notification settings - Fork 0
/
conditional.bicep
78 lines (70 loc) · 1.68 KB
/
conditional.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
param deploy bool
@allowed([
'PRD'
'DEV'
])
param Environment string
resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2020-10-01' existing = {
scope: resourceGroup('defaultresourcegroup-eus')
name: 'DefaultWorkspace-e012207b-8e1b-4f26-8a4f-ca977909d894-EUS'
}
resource storageaccount 'Microsoft.Storage/storageAccounts@2021-02-01' = if (deploy) {
name: 'storconditionalbiceptuto'
location: 'eastus'
kind: 'StorageV2'
sku: {
name: Environment == 'PRD' ? 'Premium_LRS' : 'Standard_LRS'
}
properties: {
allowBlobPublicAccess: Environment == 'PRD' ? true : false
}
}
resource rDiagnosticSetting 'microsoft.insights/diagnosticSettings@2017-05-01-preview' = {
name: 'DiagnosticsSta'
scope: storageaccount
properties: {
workspaceId: logAnalyticsWorkspace.id
metrics: [
{
category: 'Transaction'
enabled: true
retentionPolicy: {
days: 90
enabled: true
}
}
]
}
}
resource blobservice 'Microsoft.Storage/storageAccounts/blobServices@2021-06-01' existing= {
parent: storageaccount
name: 'default'
}
resource bDiagnosticSetting 'microsoft.insights/diagnosticSettings@2017-05-01-preview' = {
name: 'DiagnosticsStablob'
scope: blobservice
properties: {
workspaceId: logAnalyticsWorkspace.id
logs: [
{
category: 'StorageRead'
enabled: true
}
{
category: 'StorageWrite'
enabled: true
}
{
category: 'StorageDelete'
enabled: true
}
]
metrics: [
{
category: 'Transaction'
enabled: true
}
]
}
}
output storageAccountsku string = storageaccount.sku.tier