{
    "type": "Microsoft.Authorization/policyDefinitions",
    "properties": {
        "mode": "All",
        "parameters": {},
        "displayName": "No User Defined Route Table",
        "description": "Forbid virtual networks to use user defined route table",
        "policyRule": {
            "if": {
                "anyOf": [
                    {
                        "allOf": [
                            {
                                "field": "type",
                                "equals": "Microsoft.Network/virtualNetworks"
                            },
                            {
                                "not": {
                                    "field": "Microsoft.Network/virtualNetworks/subnets[*].routeTable.id",
                                    "exists": false
                                }
                            }
                        ]
                    },
                    {
                        "allOf": [
                            {
                                "field": "type",
                                "equals": "Microsoft.Network/virtualNetworks/subnets"
                            },
                            {
                                "field": "Microsoft.Network/virtualNetworks/subnets/routeTable.id",
                                "exists": true
                            }
                        ]
                    }
                ]
            },
            "then": {
                "effect": "deny"
            }
        }
    }
}