File tree Expand file tree Collapse file tree 2 files changed +50
-0
lines changed Expand file tree Collapse file tree 2 files changed +50
-0
lines changed Original file line number Diff line number Diff line change
1
+ param searchServiceName string = ''
2
+
3
+ @description ('Resource ID of log analytics workspace.' )
4
+ param workspaceId string
5
+
6
+ @description ('Optional. The name of logs that will be streamed.' )
7
+ param logCategoriesToEnable array = ['OperationLogs' ]
8
+
9
+ @description ('Optional. The name of metrics that will be streamed.' )
10
+ param metricsToEnable array = [
11
+ 'AllMetrics'
12
+ ]
13
+
14
+ var diagnosticsLogs = [
15
+ for category in logCategoriesToEnable : {
16
+ category : category
17
+ enabled : true
18
+ }
19
+ ]
20
+
21
+ var diagnosticsMetrics = [
22
+ for metric in metricsToEnable : {
23
+ category : metric
24
+ timeGrain : null
25
+ enabled : true
26
+ }
27
+ ]
28
+
29
+ resource searchService 'Microsoft.Search/searchServices@2023-11-01' existing = {
30
+ name : searchServiceName
31
+ }
32
+
33
+ resource app_diagnosticSettings 'Microsoft.Insights/diagnosticSettings@2021-05-01-preview' = {
34
+ name : '${searchServiceName }-diagnostics'
35
+ scope : searchService
36
+ properties : {
37
+ workspaceId : workspaceId
38
+ metrics : diagnosticsMetrics
39
+ logs : diagnosticsLogs
40
+ }
41
+ }
Original file line number Diff line number Diff line change @@ -466,6 +466,15 @@ module searchService 'core/search/search-services.bicep' = {
466
466
}
467
467
}
468
468
469
+ module searchDiagnostics 'core/search/search-diagnostics.bicep' = if (useApplicationInsights ) {
470
+ name : 'search-diagnostics'
471
+ scope : searchServiceResourceGroup
472
+ params : {
473
+ searchServiceName : searchService .outputs .name
474
+ workspaceId : useApplicationInsights ? monitoring .outputs .logAnalyticsWorkspaceId : ''
475
+ }
476
+ }
477
+
469
478
module storage 'core/storage/storage-account.bicep' = {
470
479
name : 'storage'
471
480
scope : storageResourceGroup
You can’t perform that action at this time.
0 commit comments