Azure / arm-template-whatif

A repository to track issues related to what-if noise suppression
MIT License
90 stars 14 forks source link

Noise - What-If says it will remove `Microsoft.Network/virtualNetworks` -> `properties.cloudServices` #360

Open o-l-a-v opened 7 months ago

o-l-a-v commented 7 months ago

Describe the noise

Resource type

Microsoft.Network/virtualNetworks

apiVersion

2023-09-01

Client

Azure CLI

Relevant ARM Template code (we only need the resource object for the above resourceType and apiVersion, but if it's easier you can include the entire template

resource vnetName 'Microsoft.Network/virtualNetworks@2023-09-01' = {
  name: name
  location: location
  tags: tags
  properties: {
    addressSpace: {
      addressPrefixes: [
        '1.2.3.4/5'
      ]
    }
    dhcpOptions: {
      dnsServers: [
        '1.2.3.4'
        '2.3.4.5'
      ]
    }
    subnets: [
      for subnet in subnets: {
        name: subnet.name
        properties: {
          addressPrefix: subnet.addressPrefix
          networkSecurityGroup: contains(subnet, 'networkSecurityGroup') ? subnet.networkSecurityGroup : null
          routeTable: contains(subnet, 'routeTable') ? subnet.routeTable : null
          serviceEndpoints: contains(subnet, 'serviceEndpoints') ? subnet.serviceEndpoints : null
          delegations: []
          privateEndpointNetworkPolicies: 'Enabled'
          privateLinkServiceNetworkPolicies: 'Enabled'
        }
      }
    ]
    virtualNetworkPeerings: [
      for peering in peerings: {
        name: peering.name
        properties: {
          remoteVirtualNetwork: contains(peering, 'remoteVirtualNetwork') ? peering.remoteVirtualNetwork : null
          remoteAddressSpace: contains(peering, 'remoteAddressSpace') ? peering.remoteAddressSpace : null
          doNotVerifyRemoteGateways: false
          allowVirtualNetworkAccess: true
          allowForwardedTraffic: true
          allowGatewayTransit: contains(peering, 'allowGatewayTransit') ? peering.allowGatewayTransit : null
          useRemoteGateways: false
        }
      }
    ]
    enableDdosProtection: false
  }
}

Expected response

I expect no info about properties which can't be set, changed, removed.

Current (noisy) response (either include a screenshot of the what-if output, or copy/paste the text)

~ Microsoft.Network/virtualNetworks/<redacted> [2023-09-01]
    - properties.cloudServices: [
        0:

          id: "/subscriptions/<redacted>/resourceGroups/AZUREGATEWAY-<redacted>-MIGRATED/providers/Microsoft.Compute/cloudServices/azuregateway-<redacted>"

      ]

Additional context