{
    "properties": {
        "displayName": "Azure Synapse workspaces should use customer-managed keys to encrypt data at rest",
        "description": "Use customer-managed keys to control the encryption at rest of the data stored in Azure Synapse workspaces. Customer-managed keys deliver double encryption by adding a second layer of encryption on top of the default encryption with service-managed keys.",
        "policyType": "BuiltIn",
        "mode": "Indexed",
        "metadata": {
            "version": "1.0.0",
            "category": "Synapse"
        },
        "parameters": {
            "effect": {
                "type": "String",
                "metadata": {
                    "displayName": "Effect",
                    "description": "Enable or disable the execution of the policy"
                },
                "allowedValues": [
                    "Audit",
                    "Deny",
                    "Disabled"
                ],
                "defaultValue": "Audit"
            }
        },
        "policyRule": {
            "if": {
                "allOf": [
                    {
                        "field": "type",
                        "equals": "Microsoft.Synapse/workspaces"
                    },
                    {
                        "field": "Microsoft.Synapse/workspaces/encryption.cmk.key.name",
                        "exists": false
                    }
                ]
            },
            "then": {
                "effect": "[parameters('effect')]"
            }
        }
    },
    "id": "/providers/Microsoft.Authorization/policyDefinitions/f7d52b2d-e161-4dfa-a82b-55e564167385",
    "name": "f7d52b2d-e161-4dfa-a82b-55e564167385"
}