{
  "properties": {
    "displayName": "Email notifications to admins should be enabled in SQL Managed Instance advanced data security settings",
    "policyType": "BuiltIn",
    "mode": "Indexed",
    "description": "Audit that 'email notification to admins and subscription owners' is enabled in SQL Managed Instance advanced threat protection settings. This setting ensures that any detections of anomalous activities on SQL Managed Instance are reported as soon as possible to the admins.",
    "metadata": {
      "version": "1.0.1-deprecated",
      "category": "SQL",
      "deprecated": true
    },
    "parameters": {
      "effect": {
        "type": "String",
        "defaultValue": "Disabled",
        "allowedValues": [
          "AuditIfNotExists",
          "Disabled"
        ],
        "metadata": {
          "displayName": "Effect",
          "description": "Enable or disable the execution of the policy"
        }
      }
    },
    "policyRule": {
      "if": {
        "field": "type",
        "equals": "Microsoft.Sql/managedInstances"
      },
      "then": {
        "effect": "[parameters('effect')]",
        "details": {
          "type": "Microsoft.Sql/managedInstances/securityAlertPolicies",
          "name": "default",
          "existenceCondition": {
            "field": "Microsoft.Sql/managedInstances/securityAlertPolicies/emailAccountAdmins",
            "equals": "true"
          }
        }
      }
    }
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/aeb23562-188d-47cb-80b8-551f16ef9fff",
  "name": "aeb23562-188d-47cb-80b8-551f16ef9fff"
}