Skip to content

Commit

Permalink
Unlink log analytics workspace and automation account (#555)
Browse files Browse the repository at this point in the history
Co-authored-by: Jack Tracey <[email protected]>
  • Loading branch information
picccard and jtracey93 authored Jun 14, 2023
1 parent c4f94b4 commit 48a1bfd
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
12 changes: 12 additions & 0 deletions infra-as-code/bicep/modules/logging/generateddocs/logging.bicep.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -166,6 +175,9 @@ outAutomationAccountId | string |
"VMInsights"
]
},
"parLogAnalyticsWorkspaceLinkAutomationAccount": {
"value": true
},
"parAutomationAccountName": {
"value": "alz-automation-account"
},
Expand Down
5 changes: 4 additions & 1 deletion infra-as-code/bicep/modules/logging/logging.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
"VMInsights"
]
},
"parLogAnalyticsWorkspaceLinkAutomationAccount": {
"value": true
},
"parAutomationAccountName": {
"value": "alz-automation-account"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
"VMInsights"
]
},
"parLogAnalyticsWorkspaceLinkAutomationAccount": {
"value": true
},
"parAutomationAccountName": {
"value": "alz-automation-account"
},
Expand Down

0 comments on commit 48a1bfd

Please sign in to comment.