{
    "properties": {
        "displayName": "Advanced Threat Protection types should be set to 'All' in SQL Managed Instance advanced data security settings",
        "policyType": "BuiltIn",
        "mode": "Indexed",
        "description": "It's recommended to enable all Advanced Threat Protection types on your SQL Managed Instance. Enabling all types protects against SQL injection, database vulnerabilities, and any other anomalous activities.",
        "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/disabledAlerts[*]",
                        "equals": ""
                    }
                }
            }
        }
    },
    "id": "/providers/Microsoft.Authorization/policyDefinitions/bda18df3-5e41-4709-add9-2554ce68c966",
    "name": "bda18df3-5e41-4709-add9-2554ce68c966"
}