Skip to content

feat: DiagnosticSetting - Update Bicep spec#2634

Merged
AlexanderSehr merged 38 commits intomainfrom
users/alsehr/diagnosticUpdate
Mar 26, 2026
Merged

feat: DiagnosticSetting - Update Bicep spec#2634
AlexanderSehr merged 38 commits intomainfrom
users/alsehr/diagnosticUpdate

Conversation

@AlexanderSehr
Copy link
Copy Markdown
Contributor

@AlexanderSehr AlexanderSehr commented Mar 18, 2026

Overview/Summary

Changes the implementation so that if you configure only specs OR logs, the significant other is not automatically configured with allLogs / allMetrics.

With the new implementation, if you specify e.g., custom metrics, ONLY those are configured and nothing else.

Example deployment with updated code

No specification (default - expecting everthing to be configured)

diagnosticSettings: [
  {
    name: 'customSettingDef'
    eventHubName: diagnosticDependencies.outputs.eventHubNamespaceEventHubName
    eventHubAuthorizationRuleResourceId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId
    storageAccountResourceId: diagnosticDependencies.outputs.storageAccountResourceId
    workspaceResourceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId
  }
]
image

Custom specification (explicit metrics & logs)

diagnosticSettings: [
  {
    name: 'customSettingExpl'
    eventHubName: diagnosticDependencies.outputs.eventHubNamespaceEventHubName
    eventHubAuthorizationRuleResourceId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId
    storageAccountResourceId: diagnosticDependencies.outputs.storageAccountResourceId
    workspaceResourceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId
    metricCategories: [
      {
        category: 'AllMetrics'
      }
    ]
    logCategoriesAndGroups: [
      {
        category: 'Engine'
      }
      {
        category: 'Service'
      }
    ]
  }
]
image

Custom specification (only logs => should not configure metrics)

diagnosticSettings: [
  {
    name: 'customSettingOnlyLog'
    eventHubName: diagnosticDependencies.outputs.eventHubNamespaceEventHubName
    eventHubAuthorizationRuleResourceId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId
    storageAccountResourceId: diagnosticDependencies.outputs.storageAccountResourceId
    workspaceResourceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId
    logCategoriesAndGroups: [
      {
        category: 'Engine'
      }
      {
        category: 'Service'
      }
    ]
  }
]
image

Custom specification (only metrics => should not configure logs)

diagnosticSettings: [
  {
    name: 'customSettingOnlyMetric'
    eventHubName: diagnosticDependencies.outputs.eventHubNamespaceEventHubName
    eventHubAuthorizationRuleResourceId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId
    storageAccountResourceId: diagnosticDependencies.outputs.storageAccountResourceId
    workspaceResourceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId
    metricCategories: [
      {
        category: 'AllMetrics'
      }
    ]
  }
]
image

@AlexanderSehr AlexanderSehr requested a review from a team as a code owner March 18, 2026 09:09
@AlexanderSehr AlexanderSehr self-assigned this Mar 18, 2026
@microsoft-github-policy-service microsoft-github-policy-service Bot added the Needs: Triage 🔍 Maintainers need to triage still label Mar 18, 2026
@microsoft-github-policy-service
Copy link
Copy Markdown

Important

The "Needs: Triage 🔍" label must be removed once the triage process is complete!

Tip

For additional guidance on how to triage this issue/PR, see the AVM Issue Triage documentation.

@AlexanderSehr AlexanderSehr added Type: Documentation 📄 Improvements or additions to documentation and removed Needs: Triage 🔍 Maintainers need to triage still labels Mar 18, 2026
@AlexanderSehr AlexanderSehr enabled auto-merge (squash) March 18, 2026 09:22
Copy link
Copy Markdown
Contributor

@ReneHezser ReneHezser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, Alex

@AlexanderSehr AlexanderSehr merged commit f40cfef into main Mar 26, 2026
7 checks passed
@AlexanderSehr AlexanderSehr deleted the users/alsehr/diagnosticUpdate branch March 26, 2026 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Documentation 📄 Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants