File tree Expand file tree Collapse file tree 3 files changed +26
-15
lines changed Expand file tree Collapse file tree 3 files changed +26
-15
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ param leaseContainerName string
5
5
param userManagedIdentityName string
6
6
param location string
7
7
8
+ param logAnalyticsWorkspaceName string
8
9
param appInsightsName string
9
10
param appInsightsDailyCapGb int
10
11
param actionGroupName string
@@ -56,26 +57,30 @@ resource userManagedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2
56
57
location : location
57
58
}
58
59
59
- resource appInsights 'Microsoft.Insights/components@2015-05-01' = {
60
+ resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2022-10-01' = {
61
+ name : logAnalyticsWorkspaceName
62
+ location : location
63
+ properties : {
64
+ features : {
65
+ immediatePurgeDataOn30Days : true
66
+ }
67
+ sku : {
68
+ name : 'PerGB2018'
69
+ }
70
+ retentionInDays : 30
71
+ workspaceCapping : {
72
+ dailyQuotaGb : appInsightsDailyCapGb
73
+ }
74
+ }
75
+ }
76
+
77
+ resource appInsights 'Microsoft.Insights/components@2020-02-02' = {
60
78
name : appInsightsName
61
79
location : location
62
80
kind : 'web'
63
81
properties : {
64
82
Application_Type : 'web'
65
- }
66
-
67
- // This produces a warning due to limited type definitions, but works.
68
- // See: https://github.com/Azure/bicep/issues/784#issuecomment-830997209
69
- #disable-next-line BCP081
70
- resource billing 'CurrentBillingFeatures' = {
71
- name : 'Basic'
72
- properties : {
73
- CurrentBillingFeatures : 'Basic'
74
- DataVolumeCap : {
75
- Cap : appInsightsDailyCapGb
76
- WarningThreshold : 90
77
- }
78
- }
83
+ WorkspaceResourceId : logAnalyticsWorkspace .id
79
84
}
80
85
}
81
86
Original file line number Diff line number Diff line change 14
14
"WorkerCountPerPlan" : 1 ,
15
15
"WorkerPlanCount" : 1 ,
16
16
"WorkerLogLevel" : " Warning" ,
17
+ "LogAnalyticsWorkspaceName" : " ev2-dev-usnc-insights-la" ,
17
18
"AppInsightsName" : " ev2-dev-usnc-insights-ai" ,
18
19
"AppInsightsDailyCapGb" : 1 ,
19
20
"ActionGroupName" : " ev2-dev-usnc" ,
Original file line number Diff line number Diff line change @@ -8,6 +8,9 @@ class ResourceSettings {
8
8
[ValidateNotNullOrEmpty ()]
9
9
[string ]$Location
10
10
11
+ [ValidateNotNullOrEmpty ()]
12
+ [string ]$LogAnalyticsWorkspaceName
13
+
11
14
[ValidateNotNullOrEmpty ()]
12
15
[string ]$AppInsightsName
13
16
@@ -168,6 +171,7 @@ class ResourceSettings {
168
171
}
169
172
170
173
Set-OrDefault Location " West US 2"
174
+ Set-OrDefault LogAnalyticsWorkspaceName " NuGetInsights-$StampName "
171
175
Set-OrDefault AppInsightsName " NuGetInsights-$StampName "
172
176
Set-OrDefault AppInsightsDailyCapGb 1
173
177
Set-OrDefault ActionGroupName " NuGetInsights-$StampName "
@@ -534,6 +538,7 @@ function New-MainParameters(
534
538
actionGroupShortName = $ResourceSettings.ActionGroupShortName ;
535
539
alertEmail = $ResourceSettings.AlertEmail ;
536
540
alertPrefix = $ResourceSettings.AlertPrefix ;
541
+ logAnalyticsWorkspaceName = $ResourceSettings.LogAnalyticsWorkspaceName ;
537
542
appInsightsDailyCapGb = $ResourceSettings.AppInsightsDailyCapGb ;
538
543
appInsightsName = $ResourceSettings.AppInsightsName ;
539
544
deploymentLabel = $DeploymentLabel ;
You can’t perform that action at this time.
0 commit comments