diff --git a/infra-as-code/bicep/modules/logging/generateddocs/logging.bicep.md b/infra-as-code/bicep/modules/logging/generateddocs/logging.bicep.md index a2d6abd7f..fbf2fa074 100644 --- a/infra-as-code/bicep/modules/logging/generateddocs/logging.bicep.md +++ b/infra-as-code/bicep/modules/logging/generateddocs/logging.bicep.md @@ -11,6 +11,7 @@ parLogAnalyticsWorkspaceLocation | No | Log Analytics region name - Ensure parLogAnalyticsWorkspaceSkuName | No | Log Analytics Workspace sku name. parLogAnalyticsWorkspaceLogRetentionInDays | No | Number of days of log retention for Log Analytics Workspace. parLogAnalyticsWorkspaceSolutions | No | Solutions that will be added to the Log Analytics Workspace. +parLogAnalyticsWorkspaceLinkAutomationAccount | No | Log Analytics Workspace should be linked with the automation account. parAutomationAccountName | No | Automation account name. parAutomationAccountLocation | No | Automation Account region name. - Ensure the regions selected is a supported mapping as per: https://docs.microsoft.com/azure/automation/how-to/region-mappings. parAutomationAccountUseManagedIdentity | No | Automation Account - use managed identity. @@ -63,6 +64,14 @@ Solutions that will be added to the Log Analytics Workspace. - Allowed values: `AgentHealthAssessment`, `AntiMalware`, `ChangeTracking`, `Security`, `SecurityInsights`, `ServiceMap`, `SQLAdvancedThreatProtection`, `SQLVulnerabilityAssessment`, `SQLAssessment`, `Updates`, `VMInsights` +### parLogAnalyticsWorkspaceLinkAutomationAccount + +![Parameter Setting](https://img.shields.io/badge/parameter-optional-green?style=flat-square) + +Log Analytics Workspace should be linked with the automation account. + +- Default value: `True` + ### parAutomationAccountName ![Parameter Setting](https://img.shields.io/badge/parameter-optional-green?style=flat-square) @@ -166,6 +175,9 @@ outAutomationAccountId | string | "VMInsights" ] }, + "parLogAnalyticsWorkspaceLinkAutomationAccount": { + "value": true + }, "parAutomationAccountName": { "value": "alz-automation-account" }, diff --git a/infra-as-code/bicep/modules/logging/logging.bicep b/infra-as-code/bicep/modules/logging/logging.bicep index 1c3695aec..f543ca83e 100644 --- a/infra-as-code/bicep/modules/logging/logging.bicep +++ b/infra-as-code/bicep/modules/logging/logging.bicep @@ -52,6 +52,9 @@ param parLogAnalyticsWorkspaceSolutions array = [ 'VMInsights' ] +@sys.description('Log Analytics Workspace should be linked with the automation account.') +param parLogAnalyticsWorkspaceLinkAutomationAccount bool = true + @sys.description('Automation account name.') param parAutomationAccountName string = 'alz-automation-account' @@ -120,7 +123,7 @@ resource resLogAnalyticsWorkspaceSolutions 'Microsoft.OperationsManagement/solut } }] -resource resLogAnalyticsLinkedServiceForAutomationAccount 'Microsoft.OperationalInsights/workspaces/linkedServices@2020-08-01' = { +resource resLogAnalyticsLinkedServiceForAutomationAccount 'Microsoft.OperationalInsights/workspaces/linkedServices@2020-08-01' = if (parLogAnalyticsWorkspaceLinkAutomationAccount) { name: '${resLogAnalyticsWorkspace.name}/Automation' properties: { resourceId: resAutomationAccount.id diff --git a/infra-as-code/bicep/modules/logging/parameters/logging.parameters.all.json b/infra-as-code/bicep/modules/logging/parameters/logging.parameters.all.json index 6245b9571..ac8d3a3ca 100644 --- a/infra-as-code/bicep/modules/logging/parameters/logging.parameters.all.json +++ b/infra-as-code/bicep/modules/logging/parameters/logging.parameters.all.json @@ -28,6 +28,9 @@ "VMInsights" ] }, + "parLogAnalyticsWorkspaceLinkAutomationAccount": { + "value": true + }, "parAutomationAccountName": { "value": "alz-automation-account" }, diff --git a/infra-as-code/bicep/modules/logging/parameters/mc-logging.parameters.all.json b/infra-as-code/bicep/modules/logging/parameters/mc-logging.parameters.all.json index b2e994b67..5881fbcd0 100644 --- a/infra-as-code/bicep/modules/logging/parameters/mc-logging.parameters.all.json +++ b/infra-as-code/bicep/modules/logging/parameters/mc-logging.parameters.all.json @@ -28,6 +28,9 @@ "VMInsights" ] }, + "parLogAnalyticsWorkspaceLinkAutomationAccount": { + "value": true + }, "parAutomationAccountName": { "value": "alz-automation-account" },