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

[AVM Module Issue]: diagnosticSettings for the module does not work #1938

Open
1 task done
zboukheloua opened this issue May 15, 2024 · 14 comments · May be fixed by #4494
Open
1 task done

[AVM Module Issue]: diagnosticSettings for the module does not work #1938

zboukheloua opened this issue May 15, 2024 · 14 comments · May be fixed by #4494
Assignees
Labels
Class: Resource Module 📦 This is a resource module Type: AVM 🅰️ ✌️ Ⓜ️ This is an AVM related issue Type: Bug 🐛 Something isn't working

Comments

@zboukheloua
Copy link

zboukheloua commented May 15, 2024

Check for previous/existing GitHub issues

  • I have checked for previous/existing GitHub issues

Issue Type?

Bug

Module Name

avm/res/desktop-virtualization/workspace

(Optional) Module Version

0.4.0

Description

I have the following diagnostic settings for the Workspace resource:

diagnosticSettings: [
      {
        workspaceResourceId: LogWorkspace.outputs.resourceId
        name: workSpaceDiagName
        logCategoriesAndGroups: [
          {
            categoryGroup: 'allLogs'
          }
        ]
      }
    ]

I have also tried:

    diagnosticSettings: [
      {
        name: workSpaceDiagName
        workspaceResourceId: LogWorkspace.outputs.resourceId
        logCategoriesAndGroups: [
          {
            category: 'Checkpoint'
          }
          {
            category: 'Error'
          }
          {
            category: 'Management'
          }
          {
            category: 'Feed'
          }
        ]
      }
    ]

Both do not work. The diagnostic settings of the Workspace resource stays empty. If I manually set up diagnostic settings trough the Azure portal for the Workspace resource and deploy the module again, it removes the manually set up configuration.

I have deployed a new Workspace resource and get the same results.

(Optional) Correlation Id

No response

@zboukheloua zboukheloua added Needs: Triage 🔍 Maintainers need to triage still Type: AVM 🅰️ ✌️ Ⓜ️ This is an AVM related issue labels May 15, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the Type: Bug 🐛 Something isn't working label May 15, 2024
@avm-team-linter avm-team-linter bot added the Class: Resource Module 📦 This is a resource module label May 15, 2024
@github-project-automation github-project-automation bot moved this to Needs: Triage in AVM - Module Issues May 15, 2024
Copy link

@zboukheloua, thanks for submitting this issue for the avm/res/desktop-virtualization/workspace module!

Important

A member of the @Azure/avm-res-desktopvirtualization-workspace-module-owners-bicep or @Azure/avm-res-desktopvirtualization-workspace-module-contributors-bicep team will review it soon!

@moisesjgomez
Copy link
Contributor

Thanks for reporting this bug. Will review it.

@microsoft-github-policy-service microsoft-github-policy-service bot added the Status: Response Overdue 🚩 When an issue/PR has not been responded to for X amount of days label May 21, 2024
@AlexanderSehr
Copy link
Contributor

Very strange indeed. Thanks @moisesjgomez for looking into it - I can't see any obvious issue with the deployment. I guess to troubleshoot we'd need to deploy one of the test cases with diagnosticSettings manually and try to replicate it

@AlexanderSehr AlexanderSehr removed the Needs: Triage 🔍 Maintainers need to triage still label May 21, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: Immediate Attention ‼️ Immediate attention of module owner / AVM team is needed label May 27, 2024
@moisesjgomez
Copy link
Contributor

Following up on this as I haven't resolved yet but should have more updates the following week.

@moisesjgomez moisesjgomez removed Needs: Immediate Attention ‼️ Immediate attention of module owner / AVM team is needed Status: Response Overdue 🚩 When an issue/PR has not been responded to for X amount of days labels May 31, 2024
@moisesjgomez
Copy link
Contributor

Hello team due to current priorities I've not been able to get to the bottom of this. I will follow up again next week as I should have some more time. Thanks.

@jkamping
Copy link

Hi, this issues is still happening with the workspace:0.7.1 module. I see in deployment that the parameters are passed but when checking the workspace diagnostics settings they are empty

@AlexanderSehr
Copy link
Contributor

cc: @moisesjgomez

@moisesjgomez
Copy link
Contributor

@jkamping @AlexanderSehr Thank you, will prioritize this fix this upcoming week.

@moisesjgomez
Copy link
Contributor

No status update yet on this

@jkamping
Copy link

jkamping commented Nov 14, 2024

Hi,

There is a error is de module for the diagnostics settings and it difference from what is in the hostpool and appgroup. I did some testing and for me this is working.

resource workspace_diagnosticSettings 'Microsoft.Insights/diagnosticSettings@2021-05-01-preview' = [
  for (diagnosticSetting, index) in (diagnosticSettings ?? []): {
    name: diagnosticSetting.?name ?? '${name}-diagnosticSettings'
    properties: {
      storageAccountId: diagnosticSetting.?storageAccountResourceId
      workspaceId: diagnosticSetting.?workspaceResourceId
      eventHubAuthorizationRuleId: diagnosticSetting.?eventHubAuthorizationRuleResourceId
      eventHubName: diagnosticSetting.?eventHubName
      logs: [
        for group in (diagnosticSetting.?logCategoriesAndGroups ?? [{ categoryGroup: 'allLogs' }]): {
          categoryGroup: group.?categoryGroup
          category: group.?category
          enabled: group.?enabled ?? true
        }
      ]
      marketplacePartnerId: diagnosticSetting.?marketplacePartnerResourceId
      logAnalyticsDestinationType: diagnosticSetting.?logAnalyticsDestinationType
    }
    scope: workspace
  }
]

@jkamping
Copy link

@moisesjgomez can you take a look at the suggetion above? I

@john-fox-maule
Copy link

I also ran into this issue when deploying and wanted to implement avdinsights and tested the suggestion by @jkamping too also works for me (main...john-fox-maule:bicep-registry-modules:bugfix/issue-1938l)

@AlexanderSehr
Copy link
Contributor

Hi,

There is a error is de module for the diagnostics settings and it difference from what is in the hostpool and appgroup. I did some testing and for me this is working.

resource workspace_diagnosticSettings 'Microsoft.Insights/diagnosticSettings@2021-05-01-preview' = [
for (diagnosticSetting, index) in (diagnosticSettings ?? []): {
name: diagnosticSetting.?name ?? '${name}-diagnosticSettings'
properties: {
storageAccountId: diagnosticSetting.?storageAccountResourceId
workspaceId: diagnosticSetting.?workspaceResourceId
eventHubAuthorizationRuleId: diagnosticSetting.?eventHubAuthorizationRuleResourceId
eventHubName: diagnosticSetting.?eventHubName
logs: [
for group in (diagnosticSetting.?logCategoriesAndGroups ?? [{ categoryGroup: 'allLogs' }]): {
categoryGroup: group.?categoryGroup
category: group.?category
enabled: group.?enabled ?? true
}
]
marketplacePartnerId: diagnosticSetting.?marketplacePartnerResourceId
logAnalyticsDestinationType: diagnosticSetting.?logAnalyticsDestinationType
}
scope: workspace
}
]

Wow, when seeing it in the diff it's hard to miss

@AlexanderSehr
Copy link
Contributor

AlexanderSehr commented Feb 21, 2025

On it @moisesjgomez

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Class: Resource Module 📦 This is a resource module Type: AVM 🅰️ ✌️ Ⓜ️ This is an AVM related issue Type: Bug 🐛 Something isn't working
Projects
Status: Needs: Triage
5 participants