Skip to content

Instantly share code, notes, and snippets.

@f-bader
Forked from JustinGrote/asimAuxiliaryTables.bicep
Last active August 19, 2025 05:42
Show Gist options
  • Select an option

  • Save f-bader/b80f6befd9e25c6fb5402771a8cb2a75 to your computer and use it in GitHub Desktop.

Select an option

Save f-bader/b80f6befd9e25c6fb5402771a8cb2a75 to your computer and use it in GitHub Desktop.
Create Auxiliary Table equivalents to ASIM and Common Log Sentinel Tables
param workspaceName string
param logRetentionDays int = 90
param tableNames array = [
'ASimNetworkSessionLogs'
'ASimAuthenticationEventLogs'
'ASimWebSessionLogs'
'ASimAuditEventLogs'
'ASimDhcpEventLogs'
'ASimDnsActivityLogs'
'ASimFileEventLogs'
'Syslog'
'CommonSecurityLog'
'AWSCloudTrail'
'AWSCloudWatch'
]
@allowed(['Basic', 'Auxiliary'])
param plan string = 'Auxiliary'
param reservedColumnNames array = [
'_ResourceId'
'id'
'_ResourceId'
'_SubscriptionId'
'TenantId'
'Type'
'UniqueId'
'Title'
'MG'
]
resource workspace 'Microsoft.OperationalInsights/workspaces@2023-09-01' existing = {
name: workspaceName
}
resource tables 'Microsoft.OperationalInsights/workspaces/tables@2022-10-01' existing = [for tableName in tableNames: {
parent: workspace
name: tableName
}]
resource auxTables 'Microsoft.OperationalInsights/workspaces/tables@2023-01-01-preview' = [for (tableName, i) in tableNames: {
parent: workspace
name: '${tables[i].name}_Aux_CL'
properties: {
schema: union(
tables[i].properties.schema,
{
name: '${tables[i].properties.schema.name}_Aux_CL'
displayName: null
}
)
plan: plan
totalRetentionInDays: logRetentionDays
}
}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment