Azure / arm-template-whatif

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

Noise in WhatIf `Microsoft.Network/firewallPolicies` : size #367

Open dj-r1 opened 6 months ago

dj-r1 commented 6 months ago

Describe the noise

Resource type Microsoft.Network/firewallPolicies

apiVersion 2023-09-01

Client (PowerShell, Azure CLI, or API) PowerShell

Relevant ARM Template code

resource firewallPolicies 'Microsoft.Network/firewallPolicies@2023-09-01' = {
  name: firewallPolicyName
  location: location
  properties: {
    sku: {
      tier: 'Basic'
    }
    threatIntelMode: 'Alert'
  }
}

Expected response

{
  "apiVersion": "2023-09-01",
  "id": "/subscriptions/0000bb0-000b-0bb0-0000-bb00b0b0b00/resourceGroups/MY_RESOURCE_GROUP_NAME/providers/Microsoft.Network/firewallPolicies/RESOURCENAME-fw-policy",
  "location": "polandcentral",
  "name": "RESOURCENAME-fw-policy",
  "properties": {
    "sku": {
      "tier": "Basic"
    },
    "threatIntelMode": "Alert"
  },
  "type": "Microsoft.Network/firewallPolicies"
}

Current (noisy) response

{
  "apiVersion": "2023-09-01",
  "id": "/subscriptions/0000bb0-000b-0bb0-0000-bb00b0b0b00/resourceGroups/MY_RESOURCE_GROUP_NAME/providers/Microsoft.Network/firewallPolicies/RESOURCENAME-fw-policy",
  "location": "polandcentral",
  "name": "RESOURCENAME-fw-policy",
  "properties": {
    "size": "0.001879692 MB",
    "sku": {
      "tier": "Basic"
    },
    "threatIntelMode": "Alert"
  },
  "type": "Microsoft.Network/firewallPolicies"
}

Additional context

WhatIf should not output parameter like size Noisy parameters:

dj-r1 commented 3 weeks ago

properties.size is returned in Azure REST API (Firewall Policies - Get) and also shown in example firewallPolicy.json (Azure REST API Specifications), so I think WhatIf operation would need to suppress it.