Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): Purge Application Insights data older than 30 days in yt01 #1863

Merged
merged 3 commits into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .azure/infrastructure/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ param sshJumperAdminLoginGroupObjectId string
@description('The URL of the APIM instance')
param apimUrl string

@description('Whether to purge data immediately after 30 days in Application Insights')
param appInsightsPurgeDataOn30Days bool = false

import { Sku as KeyVaultSku } from '../modules/keyvault/create.bicep'
param keyVaultSku KeyVaultSku

Expand Down Expand Up @@ -121,6 +124,7 @@ module appInsights '../modules/applicationInsights/create.bicep' = {
location: location
sku: appInsightsSku
tags: tags
immediatePurgeDataOn30Days: appInsightsPurgeDataOn30Days
}
}

Expand Down
2 changes: 2 additions & 0 deletions .azure/infrastructure/yt01.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ param environment = 'yt01'
param location = 'norwayeast'
param keyVaultSourceKeys = json(readEnvironmentVariable('AZURE_KEY_VAULT_SOURCE_KEYS'))

param appInsightsPurgeDataOn30Days = true

param redisVersion = '6.0'

// secrets
Expand Down
6 changes: 6 additions & 0 deletions .azure/modules/applicationInsights/create.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ param location string
@description('Tags to apply to resources')
param tags object

@description('Whether to purge data immediately after 30 days in Application Insights')
param immediatePurgeDataOn30Days

@export()
type Sku = {
name:
Expand All @@ -28,6 +31,9 @@ resource appInsightsWorkspace 'Microsoft.OperationalInsights/workspaces@2023-09-
name: '${namePrefix}-insightsWorkspace'
location: location
properties: {
features: {
immediatePurgeDataOn30Days: immediatePurgeDataOn30Days
}
retentionInDays: 30
sku: sku
workspaceCapping: {
Expand Down
Loading