{
    "properties": {
        "displayName": "Allowed Peering Location for Express Route",
        "description": "This policy enables you to specify a set of allowed peering location for express route",
        "parameters": {
            "listOfLocations": {
                "type": "Array",
                "metadata": {
                    "description": "The list of peering locations that can be specified for express route.",
                    "displayName": "Allowed Peering Locations",
                    "strongType": "Location"
                }
            }
        },
        "policyRule": {
            "if": {
                "allOf": [
                    {
                        "field": "type",
                        "equals": "Microsoft.Network/expressRouteCircuits"
                    },
                    {
                        "not": {
                            "field": "Microsoft.Network/expressRouteCircuits/serviceProviderProperties.peeringLocation",
                            "in": "[parameters('listOfLocations')]"
                        }
                    }
                ]
            },
            "then": {
                "effect": "Deny"
            }
        }
    }
}
