Skip to content
This repository was archived by the owner on Nov 1, 2023. It is now read-only.

Commit 826f08e

Browse files
chkeitaAdamL-Microsoft
authored andcommitted
Remove the retention policy setting (#3452)
* Remove the configuration of the autoscale diagnostic * only remove the retention policy * set retention policy to false * remove settings * remove retentionPolicy from bicep * format
1 parent 07a75c0 commit 826f08e

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

src/ApiService/ApiService/onefuzzlib/AutoScale.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,8 @@ private async Async.Task<OneFuzzResult<DiagnosticSettingsResource>> SetupAutoSca
263263
// The field is there in github though, so need to update this code once that code is released:
264264
// https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/LogSettings.cs
265265
// But setting logs one by one works the same as "allLogs" being set...
266-
var logSettings1 = new LogSettings(true) { RetentionPolicy = new RetentionPolicy(true, 30), Category = "AutoscaleEvaluations" };
267-
var logSettings2 = new LogSettings(true) { RetentionPolicy = new RetentionPolicy(true, 30), Category = "AutoscaleScaleActions" };
266+
var logSettings1 = new LogSettings(true) { Category = "AutoscaleEvaluations" };
267+
var logSettings2 = new LogSettings(true) { Category = "AutoscaleScaleActions" };
268268

269269
var parameters = new DiagnosticSettingsData {
270270
WorkspaceId = logAnalyticsWorkspaceId

src/deployment/azuredeploy.bicep

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ module autoscaleSettings 'bicep-templates/autoscale-settings.bicep' = {
167167
server_farm_id: serverFarm.outputs.id
168168
owner: owner
169169
workspaceId: operationalInsights.outputs.workspaceId
170-
logRetention: log_retention
171170
autoscale_name: 'onefuzz-autoscale-${uniqueString(resourceGroup().id)}'
172171
function_diagnostics_settings_name: 'functionDiagnosticSettings'
173172
}

src/deployment/bicep-templates/autoscale-settings.bicep

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ param location string
22
param server_farm_id string
33
param owner string
44
param workspaceId string
5-
param logRetention int
65
param autoscale_name string
76
param function_diagnostics_settings_name string
87

@@ -27,7 +26,7 @@ resource autoscaleSettings 'Microsoft.Insights/autoscalesettings@2015-04-01' = {
2726
rules: [
2827
{
2928
metricTrigger: {
30-
metricName: 'CpuPercentage'
29+
metricName: 'CpuPercentage'
3130
metricResourceUri: server_farm_id
3231
operator: 'GreaterThanOrEqual'
3332
statistic: 'Average'
@@ -50,7 +49,7 @@ resource autoscaleSettings 'Microsoft.Insights/autoscalesettings@2015-04-01' = {
5049
operator: 'LessThan'
5150
statistic: 'Average'
5251
threshold: 25
53-
timeAggregation:'Average'
52+
timeAggregation:'Average'
5453
timeGrain: 'PT1M'
5554
timeWindow: 'PT10M'
5655
}
@@ -79,10 +78,6 @@ resource functionDiagnosticSettings 'Microsoft.Insights/diagnosticSettings@2021-
7978
{
8079
categoryGroup: 'allLogs'
8180
enabled: true
82-
retentionPolicy: {
83-
days: logRetention
84-
enabled: true
85-
}
8681
}
8782
]
8883
workspaceId: workspaceId

0 commit comments

Comments
 (0)