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

Microsoft.Insights/diagnosticSettings not deployed against existing App GW resource #11374

Closed
VaclavK opened this issue Jul 27, 2023 · 1 comment

Comments

@VaclavK
Copy link

VaclavK commented Jul 27, 2023

Bicep version
0.19.5

Describe the bug
When instrumenting for Microsoft.Insights/diagnosticSettings with the scope of existing app gw resource, no diagnostic settings get deployed

To Reproduce

var appGWDeployMode  = 'existing'

resource applicationGateWayExisting 'Microsoft.Network/applicationGateways@2023-02-01' existing = if (appGWDeployMode == 'existing') {
  name: appGWName
}
resource appGWNewDiagnosticExistingSettings 'Microsoft.Insights/diagnosticSettings@2021-05-01-preview'= if (appGWDeployMode == 'existing')  {
  name: '${logAnalyticsWorkspaceName}-DiagnosticSetting'
  scope: applicationGateWayExisting 
  properties: {
    workspaceId: logAnalyticsWorkspaceId
    logs: [
      {
        categoryGroup: 'allLogs'
        enabled: true
      }
    ]
    metrics: [
      {
        category: 'AllMetrics'
        enabled: true
      }
    ]
  }
}

Additional context
this works as expected if targeting non -existing bicep resource
we have to use the existing resource construct due to #2316
we have pre-existing App GW instances and wanted to add diagnostic settings hence this existing resource construct

@anthony-c-martin
Copy link
Member

@VaclavK please could you open a support case for this?

@github-project-automation github-project-automation bot moved this from Todo to Done in Bicep Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

2 participants