{
  "properties": {
    "displayName": "Transparent Data Encryption on SQL databases should be enabled",
    "policyType": "BuiltIn",
    "mode": "Indexed",
    "description": "Transparent data encryption should be enabled to protect data-at-rest and meet compliance requirements",
    "metadata": {
      "version": "1.0.0",
      "category": "SQL"
    },
    "parameters": {
      "effect": {
        "type": "string",
        "defaultValue": "AuditIfNotExists",
        "allowedValues": [
          "AuditIfNotExists",
          "Disabled"
        ],
        "metadata": {
          "displayName": "Effect",
          "description": "Enable or disable the execution of the policy"
        }
      }
    },
    "policyRule": {
      "if": {
        "allOf": [
          {
            "field": "type",
            "equals": "Microsoft.Sql/servers/databases"
          },
          {
            "field": "name",
            "notEquals": "master"
          }
        ]
      },
      "then": {
        "effect": "[parameters('effect')]",
        "details": {
          "type": "Microsoft.Sql/servers/databases/transparentDataEncryption",
          "name": "current",
          "existenceCondition": {
            "allOf": [
              {
                "field": "Microsoft.Sql/transparentDataEncryption.status",
                "equals": "enabled"
              }
            ]
          }
        }
      }
    }
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/17k78e20-9358-41c9-923c-fb736d382a12",
  "name": "17k78e20-9358-41c9-923c-fb736d382a12"
}