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
This commit is contained in:
Cheick Keita
2023-08-25 16:35:06 -07:00
committed by GitHub
parent c49442facd
commit ead63eb3ff
3 changed files with 4 additions and 10 deletions

View File

@ -263,8 +263,8 @@ public class AutoScaleOperations : Orm<AutoScale>, IAutoScaleOperations {
// The field is there in github though, so need to update this code once that code is released: // The field is there in github though, so need to update this code once that code is released:
// https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/LogSettings.cs // https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/LogSettings.cs
// But setting logs one by one works the same as "allLogs" being set... // But setting logs one by one works the same as "allLogs" being set...
var logSettings1 = new LogSettings(true) { RetentionPolicy = new RetentionPolicy(true, 30), Category = "AutoscaleEvaluations" }; var logSettings1 = new LogSettings(true) { Category = "AutoscaleEvaluations" };
var logSettings2 = new LogSettings(true) { RetentionPolicy = new RetentionPolicy(true, 30), Category = "AutoscaleScaleActions" }; var logSettings2 = new LogSettings(true) { Category = "AutoscaleScaleActions" };
var parameters = new DiagnosticSettingsData { var parameters = new DiagnosticSettingsData {
WorkspaceId = logAnalyticsWorkspaceId WorkspaceId = logAnalyticsWorkspaceId

View File

@ -167,7 +167,6 @@ module autoscaleSettings 'bicep-templates/autoscale-settings.bicep' = {
server_farm_id: serverFarm.outputs.id server_farm_id: serverFarm.outputs.id
owner: owner owner: owner
workspaceId: operationalInsights.outputs.workspaceId workspaceId: operationalInsights.outputs.workspaceId
logRetention: log_retention
autoscale_name: 'onefuzz-autoscale-${uniqueString(resourceGroup().id)}' autoscale_name: 'onefuzz-autoscale-${uniqueString(resourceGroup().id)}'
function_diagnostics_settings_name: 'functionDiagnosticSettings' function_diagnostics_settings_name: 'functionDiagnosticSettings'
} }

View File

@ -2,7 +2,6 @@ param location string
param server_farm_id string param server_farm_id string
param owner string param owner string
param workspaceId string param workspaceId string
param logRetention int
param autoscale_name string param autoscale_name string
param function_diagnostics_settings_name string param function_diagnostics_settings_name string
@ -79,10 +78,6 @@ resource functionDiagnosticSettings 'Microsoft.Insights/diagnosticSettings@2021-
{ {
categoryGroup: 'allLogs' categoryGroup: 'allLogs'
enabled: true enabled: true
retentionPolicy: {
days: logRetention
enabled: true
}
} }
] ]
workspaceId: workspaceId workspaceId: workspaceId