Azure / Azure/Azure-Landing-Zones

"Enable allLogs category group resource logging for supported resources to Log Analytics" creates duplicate logs for Application Insights already using a Log Analytics Workspace

Open
#485 9 comments 1 reaction 0 assignees View on GitHub
Transfer From: caf-enterprise-scale :arrow_right:
Dominant language
PowerShell
Stars
96
Forks
70
Avg merge
3d 1h
Merged PRs (30d)
7

Description

### Community Note

- Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request
- Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment

### Versions

**module**: 6.0.0

### Description

#### Describe the bug

I already have an Application Insights resource which is using a Log Analytics workspace configured via the WORKSPACE config option (actually configured via azurerm_application_insights/workspace_id). This sends all logs to the Log Analytics workspace. I believe this configuration can not be removed.

If I remediate the policy "Enable allLogs category group resource logging for supported resources to Log Analytics" it creates a Diagnostic Setting "setByPolicy-LogAnalytics" for the Application Insights resource which also sends all logs to the Log Analytics workspace. Hence duplicate logs are stored in the Log Analytics workspace.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the interaction between azurerm_application_insights/workspace_id and the "Enable allLogs category group resource logging for supported resources to Log Analytics" policy on module version 6.0.0. Check how remediation creates the setByPolicy-LogAnalytics diagnostic setting, and consider the work complete when Application Insights logs reach the Log Analytics workspace without being stored twice.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, terraform
Domain
cloud, observability-sre
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.