1
+ // Example of Microsoft.Dashboard/grafana resources
2
+ // This file contains multiple examples to test all the properties defined in our CodeQL module
3
+
4
+ // Basic grafana resource with minimum required properties
5
+ resource basicGrafana 'Microsoft.Dashboard/grafana@2024-11-01-preview' = {
6
+ name : 'basic-grafana'
7
+ location : 'westus2'
8
+ properties : {}
9
+ sku : {
10
+ name : 'Standard'
11
+ }
12
+ }
13
+
14
+ // Grafana with public network access enabled - used to test PublicGrafanaResource class
15
+ resource publicGrafana 'Microsoft.Dashboard/grafana@2024-11-01-preview' = {
16
+ name : 'public-grafana'
17
+ location : 'eastus'
18
+ properties : {
19
+ publicNetworkAccess : 'Enabled'
20
+ }
21
+ sku : {
22
+ name : 'Standard'
23
+ }
24
+ }
25
+
26
+ // Grafana with public network access explicitly disabled
27
+ resource privateGrafana 'Microsoft.Dashboard/grafana@2024-11-01-preview' = {
28
+ name : 'private-grafana'
29
+ location : 'westeurope'
30
+ properties : {
31
+ publicNetworkAccess : 'Disabled'
32
+ }
33
+ sku : {
34
+ name : 'Standard'
35
+ }
36
+ }
37
+
38
+ // Grafana with identity configuration
39
+ resource identityGrafana 'Microsoft.Dashboard/grafana@2024-11-01-preview' = {
40
+ name : 'identity-grafana'
41
+ location : 'eastus2'
42
+ identity : {
43
+ type : 'SystemAssigned'
44
+ }
45
+ properties : {}
46
+ sku : {
47
+ name : 'Standard'
48
+ }
49
+ }
50
+
51
+ // Grafana with user assigned identity
52
+ resource userIdentityGrafana 'Microsoft.Dashboard/grafana@2024-11-01-preview' = {
53
+ name : 'user-identity-grafana'
54
+ location : 'westus'
55
+ identity : {
56
+ type : 'UserAssigned'
57
+ userAssignedIdentities : {
58
+ '/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/my-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/my-identity' : {}
59
+ }
60
+ }
61
+ properties : {}
62
+ sku : {
63
+ name : 'Standard'
64
+ }
65
+ }
66
+
67
+ // Comprehensive Grafana resource with all main properties
68
+ resource comprehensiveGrafana 'Microsoft.Dashboard/grafana@2024-11-01-preview' = {
69
+ name : 'comprehensive-grafana'
70
+ location : 'centralus'
71
+ identity : {
72
+ type : 'SystemAssigned,UserAssigned'
73
+ userAssignedIdentities : {
74
+ '/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/my-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/my-identity' : {}
75
+ }
76
+ }
77
+ properties : {
78
+ apiKey : 'Enabled'
79
+ autoGeneratedDomainNameLabelScope : 'TenantReuse'
80
+ deterministicOutboundIP : 'Enabled'
81
+ grafanaMajorVersion : '10'
82
+ publicNetworkAccess : 'Enabled'
83
+ zoneRedundancy : 'Enabled'
84
+ }
85
+ sku : {
86
+ name : 'Standard'
87
+ }
88
+ tags : {
89
+ Environment : 'Production'
90
+ Department : 'IT'
91
+ }
92
+ }
93
+
94
+ // Grafana with enterprise configurations
95
+ resource enterpriseGrafana 'Microsoft.Dashboard/grafana@2024-11-01-preview' = {
96
+ name : 'enterprise-grafana'
97
+ location : 'northeurope'
98
+ properties : {
99
+ enterpriseConfigurations : {
100
+ marketplaceAutoRenew : 'Enabled'
101
+ marketplacePlanId : 'enterprise-plan-123'
102
+ }
103
+ }
104
+ sku : {
105
+ name : 'Enterprise'
106
+ }
107
+ }
108
+
109
+ // Grafana with security settings
110
+ resource securityGrafana 'Microsoft.Dashboard/grafana@2024-11-01-preview' = {
111
+ name : 'security-grafana'
112
+ location : 'uksouth'
113
+ properties : {
114
+ grafanaConfigurations : {
115
+ security : {
116
+ csrfAlwaysCheck : true
117
+ }
118
+ }
119
+ }
120
+ sku : {
121
+ name : 'Standard'
122
+ }
123
+ }
124
+
125
+ // Grafana with SMTP configuration
126
+ resource smtpGrafana 'Microsoft.Dashboard/grafana@2024-11-01-preview' = {
127
+ name : 'smtp-grafana'
128
+ location : 'japaneast'
129
+ properties : {
130
+ grafanaConfigurations : {
131
+ smtp : {
132
+ enabled : true
133
+ fromAddress : 'grafana@example.com'
134
+ fromName : 'Grafana Alerts'
135
+ host : 'smtp.example.com:587'
136
+ password : 'SecurePasswordHere'
137
+ skipVerify : false
138
+ startTLSPolicy : 'MandatoryStartTLS'
139
+ user : 'grafanauser'
140
+ }
141
+ }
142
+ }
143
+ sku : {
144
+ name : 'Standard'
145
+ }
146
+ }
147
+
148
+ // Grafana with snapshots configuration
149
+ resource snapshotsGrafana 'Microsoft.Dashboard/grafana@2024-11-01-preview' = {
150
+ name : 'snapshots-grafana'
151
+ location : 'brazilsouth'
152
+ properties : {
153
+ grafanaConfigurations : {
154
+ snapshots : {
155
+ externalEnabled : false
156
+ }
157
+ }
158
+ }
159
+ sku : {
160
+ name : 'Standard'
161
+ }
162
+ }
163
+
164
+ // Grafana with unified alerting screenshots configuration
165
+ resource alertingGrafana 'Microsoft.Dashboard/grafana@2024-11-01-preview' = {
166
+ name : 'alerting-grafana'
167
+ location : 'australiaeast'
168
+ properties : {
169
+ grafanaConfigurations : {
170
+ unifiedAlertingScreenshots : {
171
+ captureEnabled : false
172
+ }
173
+ }
174
+ }
175
+ sku : {
176
+ name : 'Standard'
177
+ }
178
+ }
179
+
180
+ // Grafana with users configuration
181
+ resource usersGrafana 'Microsoft.Dashboard/grafana@2024-11-01-preview' = {
182
+ name : 'users-grafana'
183
+ location : 'southcentralus'
184
+ properties : {
185
+ grafanaConfigurations : {
186
+ users : {
187
+ editorsCanAdmin : true
188
+ viewersCanEdit : true
189
+ }
190
+ }
191
+ }
192
+ sku : {
193
+ name : 'Standard'
194
+ }
195
+ }
196
+
197
+ // Grafana with integrations configuration
198
+ resource integrationsGrafana 'Microsoft.Dashboard/grafana@2024-11-01-preview' = {
199
+ name : 'integrations-grafana'
200
+ location : 'eastus2'
201
+ properties : {
202
+ grafanaIntegrations : {
203
+ azureMonitorWorkspaceIntegrations : [
204
+ {
205
+ azureMonitorWorkspaceResourceId : '/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/my-rg/providers/Microsoft.OperationalInsights/workspaces/my-workspace'
206
+ },
207
+ {
208
+ azureMonitorWorkspaceResourceId : '/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/my-rg/providers/Microsoft.OperationalInsights/workspaces/my-second-workspace'
209
+ }
210
+ ]
211
+ }
212
+ }
213
+ sku : {
214
+ name : 'Standard'
215
+ }
216
+ }
217
+
218
+ // Grafana with plugins configuration
219
+ resource pluginsGrafana 'Microsoft.Dashboard/grafana@2024-11-01-preview' = {
220
+ name : 'plugins-grafana'
221
+ location : 'canadacentral'
222
+ properties : {
223
+ grafanaPlugins : {
224
+ 'grafana-worldmap-panel' : {}
225
+ 'grafana-piechart-panel' : {}
226
+ }
227
+ }
228
+ sku : {
229
+ name : 'Standard'
230
+ }
231
+ }
232
+
233
+ // Super comprehensive Grafana resource with all properties
234
+ resource fullGrafana 'Microsoft.Dashboard/grafana@2024-11-01-preview' = {
235
+ name : 'full-featured-grafana'
236
+ location : 'westus3'
237
+ identity : {
238
+ type : 'SystemAssigned,UserAssigned'
239
+ userAssignedIdentities : {
240
+ '/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/my-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/my-identity' : {}
241
+ }
242
+ }
243
+ properties : {
244
+ apiKey : 'Enabled'
245
+ autoGeneratedDomainNameLabelScope : 'TenantReuse'
246
+ deterministicOutboundIP : 'Enabled'
247
+ grafanaMajorVersion : '10'
248
+ publicNetworkAccess : 'Enabled'
249
+ zoneRedundancy : 'Enabled'
250
+ enterpriseConfigurations : {
251
+ marketplaceAutoRenew : 'Enabled'
252
+ marketplacePlanId : 'enterprise-plan-premium'
253
+ }
254
+ grafanaConfigurations : {
255
+ security : {
256
+ csrfAlwaysCheck : true
257
+ }
258
+ smtp : {
259
+ enabled : true
260
+ fromAddress : 'grafana@company.com'
261
+ fromName : 'Grafana Enterprise Alerts'
262
+ host : 'smtp.company.com:587'
263
+ password : 'SecureEnterprisePassword'
264
+ skipVerify : false
265
+ startTLSPolicy : 'MandatoryStartTLS'
266
+ user : 'grafanaadmin'
267
+ }
268
+ snapshots : {
269
+ externalEnabled : false
270
+ }
271
+ unifiedAlertingScreenshots : {
272
+ captureEnabled : true
273
+ }
274
+ users : {
275
+ editorsCanAdmin : true
276
+ viewersCanEdit : false
277
+ }
278
+ }
279
+ grafanaIntegrations : {
280
+ azureMonitorWorkspaceIntegrations : [
281
+ {
282
+ azureMonitorWorkspaceResourceId : '/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/my-rg/providers/Microsoft.OperationalInsights/workspaces/primary-workspace'
283
+ },
284
+ {
285
+ azureMonitorWorkspaceResourceId : '/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/my-rg/providers/Microsoft.OperationalInsights/workspaces/secondary-workspace'
286
+ }
287
+ ]
288
+ }
289
+ grafanaPlugins : {
290
+ 'grafana-worldmap-panel' : {}
291
+ 'grafana-piechart-panel' : {}
292
+ 'grafana-clock-panel' : {}
293
+ 'grafana-azure-monitor-datasource' : {}
294
+ }
295
+ }
296
+ sku : {
297
+ name : 'Enterprise'
298
+ }
299
+ tags : {
300
+ Environment : 'Production'
301
+ Department : 'Engineering'
302
+ CostCenter : 'CC-123456'
303
+ Project : 'Enterprise Monitoring'
304
+ }
305
+ }
306
+
307
+ // Grafana with an older API version
308
+ resource olderVersionGrafana 'Microsoft.Dashboard/grafana@2023-09-01' = {
309
+ name : 'older-version-grafana'
310
+ location : 'eastus'
311
+ properties : {
312
+ apiKey : 'Enabled'
313
+ }
314
+ sku : {
315
+ name : 'Standard'
316
+ }
317
+ }
0 commit comments