This repository was archived by the owner on Mar 31, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ param leaseContainerName string
55param userManagedIdentityName string
66param location string
77
8+ param logAnalyticsWorkspaceName string
89param appInsightsName string
910param appInsightsDailyCapGb int
1011param actionGroupName string
@@ -56,26 +57,30 @@ resource userManagedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2
5657 location : location
5758}
5859
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' = {
6078 name : appInsightsName
6179 location : location
6280 kind : 'web'
6381 properties : {
6482 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
7984 }
8085}
8186
Original file line number Diff line number Diff line change 1414 "WorkerCountPerPlan" : 1 ,
1515 "WorkerPlanCount" : 1 ,
1616 "WorkerLogLevel" : " Warning" ,
17+ "LogAnalyticsWorkspaceName" : " ev2-dev-usnc-insights-la" ,
1718 "AppInsightsName" : " ev2-dev-usnc-insights-ai" ,
1819 "AppInsightsDailyCapGb" : 1 ,
1920 "ActionGroupName" : " ev2-dev-usnc" ,
Original file line number Diff line number Diff line change @@ -8,6 +8,9 @@ class ResourceSettings {
88 [ValidateNotNullOrEmpty ()]
99 [string ]$Location
1010
11+ [ValidateNotNullOrEmpty ()]
12+ [string ]$LogAnalyticsWorkspaceName
13+
1114 [ValidateNotNullOrEmpty ()]
1215 [string ]$AppInsightsName
1316
@@ -168,6 +171,7 @@ class ResourceSettings {
168171 }
169172
170173 Set-OrDefault Location " West US 2"
174+ Set-OrDefault LogAnalyticsWorkspaceName " NuGetInsights-$StampName "
171175 Set-OrDefault AppInsightsName " NuGetInsights-$StampName "
172176 Set-OrDefault AppInsightsDailyCapGb 1
173177 Set-OrDefault ActionGroupName " NuGetInsights-$StampName "
@@ -534,6 +538,7 @@ function New-MainParameters(
534538 actionGroupShortName = $ResourceSettings.ActionGroupShortName ;
535539 alertEmail = $ResourceSettings.AlertEmail ;
536540 alertPrefix = $ResourceSettings.AlertPrefix ;
541+ logAnalyticsWorkspaceName = $ResourceSettings.LogAnalyticsWorkspaceName ;
537542 appInsightsDailyCapGb = $ResourceSettings.AppInsightsDailyCapGb ;
538543 appInsightsName = $ResourceSettings.AppInsightsName ;
539544 deploymentLabel = $DeploymentLabel ;
You can’t perform that action at this time.
0 commit comments