{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-sql-database/json-schema/microsoft-azure-sql-database-data-masking-policy-schema.json",
  "title": "DataMaskingPolicy",
  "description": "A database data masking policy.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-azure-sql-database-datamaskingpolicies-api-openapi.yml#/components/schemas/DataMaskingPolicy",
  "type": "object",
  "properties": {
    "properties": {
      "$ref": "#/$defs/DataMaskingPolicyProperties",
      "description": "Resource properties.",
      "x-ms-client-flatten": true
    },
    "location": {
      "type": "string",
      "description": "The location of the data masking policy.",
      "readOnly": true
    },
    "kind": {
      "type": "string",
      "description": "The kind of Data Masking Policy. Metadata, used for Azure portal.",
      "readOnly": true
    }
  },
  "allOf": [
    {
      "$ref": "#/$defs/ProxyResource"
    }
  ],
  "$defs": {
    "DataMaskingPolicyProperties": {
      "type": "object",
      "description": "The properties of a database data masking policy.",
      "properties": {
        "dataMaskingState": {
          "$ref": "#/$defs/DataMaskingState",
          "description": "The state of the data masking policy."
        },
        "exemptPrincipals": {
          "type": "string",
          "description": "The list of the exempt principals. Specifies the semicolon-separated list of database users for which the data masking policy does not apply. The specified users receive data results without masking for all of the database queries."
        },
        "applicationPrincipals": {
          "type": "string",
          "description": "The list of the application principals. This is a legacy parameter and is no longer used.",
          "readOnly": true
        },
        "maskingLevel": {
          "type": "string",
          "description": "The masking level. This is a legacy parameter and is no longer used.",
          "readOnly": true
        }
      },
      "required": [
        "dataMaskingState"
      ]
    },
    "DataMaskingState": {
      "type": "string",
      "description": "The state of the data masking policy.",
      "enum": [
        "Enabled",
        "Disabled"
      ],
      "x-ms-enum": {
        "name": "DataMaskingState",
        "modelAsString": false,
        "values": [
          {
            "name": "Enabled",
            "value": "Enabled",
            "description": "Enabled"
          },
          {
            "name": "Disabled",
            "value": "Disabled",
            "description": "Disabled"
          }
        ]
      }
    },
    "ProxyResource": {
      "type": "object",
      "title": "Proxy Resource",
      "description": "The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location",
      "allOf": [
        {
          "$ref": "#/$defs/Resource"
        }
      ]
    }
  }
}