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

diagnostic name with log analytics workspace name #414

Merged
Show file tree
Hide file tree
Changes from all 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
8 changes: 4 additions & 4 deletions src/bicep/mlz.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -300,35 +300,35 @@ module hubSubscriptionCreateActivityLogging './modules/centralLogging.bicep' = {
name: 'deploy-hub-sub-activity-logging'
scope: subscription(hubSubscriptionId)
params: {
diagnosticSettingName: 'log-hub-sub-activity-to-${logAnalyticsWorkspace.outputs.name}'
logAnalyticsWorkspaceId: logAnalyticsWorkspace.outputs.id
deploymentName: resourcePrefix
}
}

module operationsSubscriptionCreateActivityLogging './modules/centralLogging.bicep' = if(hubSubscriptionId != operationsSubscriptionId) {
name: 'deploy-operations-sub-activity-logging'
scope: subscription(operationsSubscriptionId)
params: {
diagnosticSettingName: 'log-operations-sub-activity-to-${logAnalyticsWorkspace.outputs.name}'
logAnalyticsWorkspaceId: logAnalyticsWorkspace.outputs.id
deploymentName: resourcePrefix
}
}

module identitySubscriptionCreateActivityLogging './modules/centralLogging.bicep' = if(hubSubscriptionId != identitySubscriptionId) {
name: 'deploy-identity-sub-activity-logging'
scope: subscription(identitySubscriptionId)
params: {
diagnosticSettingName: 'log-identity-sub-activity-to-${logAnalyticsWorkspace.outputs.name}'
logAnalyticsWorkspaceId: logAnalyticsWorkspace.outputs.id
deploymentName: resourcePrefix
}
}

module sharedServicesSubscriptionCreateActivityLogging './modules/centralLogging.bicep' = if(hubSubscriptionId != sharedServicesSubscriptionId) {
name: 'deploy-sharedServices-sub-activity-logging'
scope: subscription(sharedServicesSubscriptionId)
params: {
diagnosticSettingName: 'log-sharedServices-sub-activity-to-${logAnalyticsWorkspace.outputs.name}'
logAnalyticsWorkspaceId: logAnalyticsWorkspace.outputs.id
deploymentName: resourcePrefix
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/bicep/modules/centralLogging.bicep
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// scope
targetScope = 'subscription'

param diagnosticSettingName string
param logAnalyticsWorkspaceId string
param deploymentName string

//// Central activity logging to LAWS
resource centralLoggingDiagnosticSettings 'Microsoft.Insights/diagnosticSettings@2021-05-01-preview' = {
name: 'LoggingToLA-${deploymentName}'
name: diagnosticSettingName
properties: {
workspaceId: logAnalyticsWorkspaceId
logs: [
Expand Down