Use valid Firewall names

March 21, 2025 ยท View on GitHub

SYNOPSIS

Firewall names should meet naming requirements.

DESCRIPTION

When naming Azure resources, resource names must meet service requirements. The requirements for Firewall names are:

  • Between 1 and 80 characters long.
  • Alphanumerics, underscores, periods, and hyphens.
  • Start with alphanumeric.
  • End alphanumeric or underscore.
  • Firewall names must be unique within a resource group.

RECOMMENDATION

Consider using names that meet Firewall naming requirements. Additionally consider naming resources with a standard naming convention.

EXAMPLES

Configure with Azure template

To deploy firewalls that pass this rule:

  • Set the name property to align to resource naming requirements.

For example:

{
  "type": "Microsoft.Network/azureFirewalls",
  "apiVersion": "2023-02-01",
  "name": "[parameters('name')]",
  "location": "[parameters('location')]",
  "properties": {
    "sku": {
      "name": "AZFW_VNet",
      "tier": "Premium"
    },
    "firewallPolicy": {
      "id": "[resourceId('Microsoft.Network/firewallPolicies', format('{0}_policy', parameters('name')))]"
    }
  },
  "dependsOn": [
    "firewall_policy"
  ]
}

Configure with Bicep

To deploy firewalls that pass this rule:

  • Set the name property to align to resource naming requirements.

For example:

resource firewall 'Microsoft.Network/azureFirewalls@2023-02-01' = {
  name: name
  location: location
  properties: {
    sku: {
      name: 'AZFW_VNet'
      tier: 'Premium'
    }
    firewallPolicy: {
      id: firewall_policy.id
    }
  }
}

NOTES

This rule does not check if Firewall names are unique.