Azure Custom Tag Policy, Exclude resource type

This way you can mention all the resource types in "notEquals" operator for which you do not want to check for tags.

{
      "if": {
        "allOf": [
          {
            "field": "type",
            "notEquals": "Microsoft.Security/assessments"
          },
          {
            "field": "type",
            "notEquals": "Microsoft.Compute/VirtualMachines"
          },
          {
            "anyOf": [
              {
                "field": "tags['TAG1']",
                "exists": false
              },
              {
                "field": "tags['TAG2']",
                "exists": false
              }
            ]
          }
        ]
      },
      "then": {
        "effect": "audit"
      }
    }

Using "mode": "indexed" instead of "mode": "All" will only match resources that support location and tags.

Source: https://docs.microsoft.com/en-us/azure/governance/policy/concepts/definition-structure#resource-manager-modes