{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-sql-database/json-schema/microsoft-azure-sql-database-managed-database-security-alert-policy-schema.json",
  "title": "ManagedDatabaseSecurityAlertPolicy",
  "description": "A managed database security alert policy.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-azure-sql-database-manageddatabasesecurityalertpolicies-api-openapi.yml#/components/schemas/ManagedDatabaseSecurityAlertPolicy",
  "type": "object",
  "properties": {
    "properties": {
      "$ref": "#/$defs/SecurityAlertPolicyProperties",
      "description": "Resource properties.",
      "x-ms-client-flatten": true
    }
  },
  "allOf": [
    {
      "$ref": "#/$defs/ProxyResource"
    }
  ],
  "$defs": {
    "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"
        }
      ]
    },
    "Resource": {
      "type": "object",
      "description": "Referenced by this document but never defined in it. API Evangelist added this empty placeholder so the document resolves; the shape is unknown and is NOT a claim about the API.",
      "x-ae-placeholder": true
    },
    "SecurityAlertPolicyProperties": {
      "type": "object",
      "description": "Properties of a security alert policy.",
      "properties": {
        "state": {
          "$ref": "#/$defs/SecurityAlertPolicyState",
          "description": "Specifies the state of the policy, whether it is enabled or disabled or a policy has not been applied yet on the specific database."
        },
        "disabledAlerts": {
          "type": "array",
          "description": "Specifies an array of alerts that are disabled. Allowed values are: Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly, Data_Exfiltration, Unsafe_Action, Brute_Force",
          "items": {
            "type": "string"
          }
        },
        "emailAddresses": {
          "type": "array",
          "description": "Specifies an array of e-mail addresses to which the alert is sent.",
          "items": {
            "type": "string"
          }
        },
        "emailAccountAdmins": {
          "type": "boolean",
          "description": "Specifies that the alert is sent to the account administrators."
        },
        "storageEndpoint": {
          "type": "string",
          "description": "Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs."
        },
        "storageAccountAccessKey": {
          "type": "string",
          "description": "Specifies the identifier key of the Threat Detection audit storage account."
        },
        "retentionDays": {
          "type": "integer",
          "format": "int32",
          "description": "Specifies the number of days to keep in the Threat Detection audit logs."
        },
        "creationTime": {
          "type": "string",
          "format": "date-time",
          "description": "Specifies the UTC creation time of the policy.",
          "readOnly": true
        }
      },
      "required": [
        "state"
      ]
    },
    "SecurityAlertPolicyState": {
      "type": "string",
      "description": "Specifies the state of the policy, whether it is enabled or disabled or a policy has not been applied yet on the specific database.",
      "enum": [
        "New",
        "Enabled",
        "Disabled"
      ],
      "x-ms-enum": {
        "name": "SecurityAlertPolicyState",
        "modelAsString": false,
        "values": [
          {
            "name": "New",
            "value": "New",
            "description": "New"
          },
          {
            "name": "Enabled",
            "value": "Enabled",
            "description": "Enabled"
          },
          {
            "name": "Disabled",
            "value": "Disabled",
            "description": "Disabled"
          }
        ]
      }
    }
  }
}