Skip to content

Missing A records for Log Analytics with PE and AMPLS #41

@asmason

Description

@asmason

Hello,

With the current logging.bicep, no A records are created for the Log Analytics Workspace with private endpoint and AMPLS. This code is needed.

// For DNS A records for Azure Monitor with PE and AMPLS.
resource existingStorageAccountPrivateDnsZone 'Microsoft.Network/privateDnsZones@2020-06-01' existing = {
  name: storageAccountPrivateDnsZoneName
}
resource existingMonitorPrivateDnsZone 'Microsoft.Network/privateDnsZones@2020-06-01' existing = {
  name: monitorPrivateDnsZoneName
}
resource existingOmsPrivateDnsZone 'Microsoft.Network/privateDnsZones@2020-06-01' existing = {
  name: omsPrivateDnsZoneName
}
resource existingOdsPrivateDnsZone 'Microsoft.Network/privateDnsZones@2020-06-01' existing = {
  name: odsPrivateDnsZoneName
}
resource existingAgentSvcPrivateDnsZone 'Microsoft.Network/privateDnsZones@2020-06-01' existing = {
  name: agentSvcPrivateDnsZoneName
}

param storageAccountPrivateDnsZoneName string
param monitorPrivateDnsZoneName string
param omsPrivateDnsZoneName string
param odsPrivateDnsZoneName string
param agentSvcPrivateDnsZoneName string

resource privateEndpointDnsGroup 'Microsoft.Network/privateEndpoints/privateDnsZoneGroups@2022-09-01' = if(usePrivateEndpoint){
  parent: privateLinkScopePrivateEndpoint
  name: 'privateDnsZoneGroup'
  properties: {
    privateDnsZoneConfigs: [
      {
        name: replace(monitorPrivateDnsZoneName,'.','-')
        properties: {
          privateDnsZoneId: existingMonitorPrivateDnsZone.id
        }
      }
      {
        name: replace(omsPrivateDnsZoneName,'.','-')
        properties: {
          privateDnsZoneId: existingOmsPrivateDnsZone.id
        }
      }
      {
        name: replace(odsPrivateDnsZoneName,'.','-')
        properties: {
          privateDnsZoneId: existingOdsPrivateDnsZone.id
        }
      }
      {
        name: replace(agentSvcPrivateDnsZoneName,'.','-')
        properties: {
          privateDnsZoneId: existingAgentSvcPrivateDnsZone.id
        }
      }
      {
        name: replace(storageAccountPrivateDnsZoneName,'.','-')
        properties: {
          privateDnsZoneId: existingStorageAccountPrivateDnsZone.id
        }
      }                        
    ]
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions