-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
LogAnalyticsWorkspaces_DefaultWorkspace_DINE.json
242 lines (242 loc) · 9.01 KB
/
LogAnalyticsWorkspaces_DefaultWorkspace_DINE.json
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
{
"properties": {
"displayName": "Configure Log Analytics workspace and automation account to centralize logs and monitoring",
"policyType": "BuiltIn",
"mode": "All",
"description": "Deploy resource group containing Log Analytics workspace and linked automation account to centralize logs and monitoring. The automation account is aprerequisite for solutions like Updates and Change Tracking.",
"metadata": {
"version": "2.0.0",
"category": "Monitoring"
},
"version": "2.0.0",
"parameters": {
"rgName": {
"type": "String",
"metadata": {
"displayName": "rgName",
"description": "Provide name for resource group"
},
"defaultValue": "CentralRG"
},
"workspaceName": {
"type": "String",
"metadata": {
"displayName": "workspaceName",
"description": "Provide name for log analytics workspace"
},
"defaultValue": "CentralWorkspace"
},
"workspaceRegion": {
"type": "String",
"metadata": {
"displayName": "workspaceRegion",
"description": "Enter Azure region for Log Analytics workspace",
"strongType": "location"
}
},
"sku": {
"type": "String",
"metadata": {
"displayName": "sku",
"description": "Select pricing tier. Legacy tiers (Free, Standalone, PerNode, Standard or Premium) are not available to all customers"
},
"allowedValues": [
"pergb2018",
"Free",
"Standalone",
"PerNode",
"Standard",
"Premium"
],
"defaultValue": "pergb2018"
},
"dataRetention": {
"type": "String",
"metadata": {
"displayName": "dataRetention",
"description": "Enter the retention period in workspace, can be between 7 to 730 days. Billing is per 30 days at the minimum even when retention is shorter"
},
"defaultValue": "30"
},
"automationAccountName": {
"type": "String",
"metadata": {
"displayName": "automationAccountName",
"description": "Provide name for automation account"
},
"defaultValue": "CentralAutomationAccount"
},
"automationRegion": {
"type": "String",
"metadata": {
"displayName": "automationRegion",
"description": "Select Azure region for automation account",
"strongType": "location"
}
},
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "Select DeployIfNotExists to deploy central Log Analytics workspace, Audit or Disable to disable the execution of the policy"
},
"allowedValues": [
"DeployIfNotExists",
"AuditIfNotExists",
"Disabled"
],
"defaultValue": "DeployIfNotExists"
}
},
"policyRule": {
"if": {
"field": "type",
"equals": "Microsoft.Resources/subscriptions"
},
"then": {
"effect": "[parameters('effect')]",
"details": {
"type": "Microsoft.OperationalInsights/workspaces",
"name": "[parameters('workspaceName')]",
"ResourceGroupName": "[parameters('rgName')]",
"existenceScope": "resourcegroup",
"deploymentScope": "Subscription",
"roleDefinitionIds": [
"/providers/Microsoft.Authorization/roleDefinitions/b24988ac-6180-42a0-ab88-20f7382dd24c"
],
"deployment": {
"location": "West Central US",
"properties": {
"mode": "incremental",
"parameters": {
"rgName": {
"value": "[parameters('rgName')]"
},
"workspaceName": {
"value": "[parameters('workspaceName')]"
},
"workspaceRegion": {
"value": "[parameters('workspaceRegion')]"
},
"dataRetention": {
"value": "[parameters('dataRetention')]"
},
"sku": {
"value": "[parameters('sku')]"
},
"automationAccountName": {
"value": "[parameters('automationAccountName')]"
},
"automationRegion": {
"value": "[parameters('automationRegion')]"
}
},
"template": {
"$schema": "http://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"rgName": {
"type": "String"
},
"workspaceName": {
"type": "String"
},
"workspaceRegion": {
"type": "String"
},
"dataRetention": {
"type": "String"
},
"sku": {
"type": "String"
},
"automationAccountName": {
"type": "String"
},
"automationRegion": {
"type": "String"
}
},
"variables": {},
"resources": [
{
"type": "Microsoft.Resources/resourceGroups",
"apiVersion": "2020-06-01",
"name": "[parameters('rgName')]",
"location": "[parameters('workspaceRegion')]",
"properties": {}
},
{
"type": "Microsoft.Resources/deployments",
"apiVersion": "2021-04-01",
"name": "log-analytics",
"resourceGroup": "[parameters('rgName')]",
"dependsOn": [
"[resourceId('Microsoft.Resources/resourceGroups/', parameters('rgName'))]"
],
"properties": {
"mode": "Incremental",
"template": {
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json",
"contentVersion": "1.0.0.0",
"parameters": {},
"variables": {},
"resources": [
{
"apiversion": "2015-10-31",
"location": "[parameters('AutomationRegion')]",
"name": "[parameters('AutomationAccountName')]",
"type": "Microsoft.Automation/automationAccounts",
"comments": "Automation account for Log Analytics workapce",
"properties": {
"sku": {
"name": "OMS"
}
}
},
{
"apiVersion": "2020-08-01",
"location": "[parameters('workspaceRegion')]",
"name": "[parameters('workspaceName')]",
"type": "Microsoft.OperationalInsights/workspaces",
"properties": {
"sku": {
"name": "[parameters('sku')]"
},
"retentionInDays": "[parameters('dataRetention')]",
"enableLogAccessUsingOnlyResourcePermissions": true
},
"resources": [
{
"name": "Automation",
"type": "linkedServices",
"apiVersion": "2020-08-01",
"properties": {
"resourceId": "[concat(subscription().id, '/resourceGroups/', parameters('rgName'), '/providers/Microsoft.Automation/automationAccounts/', parameters('AutomationAccountName'))]"
},
"dependsOn": [
"[parameters('workspaceName')]",
"[parameters('AutomationAccountName')]"
]
}
]
}
],
"outputs": {}
}
}
}
]
}
}
}
}
}
},
"versions": [
"2.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/8e3e61b3-0b32-22d5-4edf-55f87fdb5955",
"name": "8e3e61b3-0b32-22d5-4edf-55f87fdb5955"
}