{
    "properties": {
        "displayName": "Configure Azure Synapse workspaces to disable public network access",
        "description": "Disable public network access for your Synapse workspace so that it is not accessible over the public internet. This can reduce data leakage risks. Learn more at: https://docs.microsoft.com/azure/synapse-analytics/security/connectivity-settings.",
        "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": [
                    "Modify",
                    "Disabled"
                ],
                "defaultValue": "Modify"
            }
        },
        "policyRule": {
            "if": {
                "allOf": [
                    {
                        "field": "type",
                        "equals": "Microsoft.Synapse/workspaces"
                    },
                    {
                        "field": "Microsoft.Synapse/workspaces/publicNetworkAccess",
                        "notEquals": "Disabled"
                    }
                ]
            },
            "then": {
                "effect": "[parameters('effect')]",
                "details": {
                  "conflictEffect": "audit", 
                  "roleDefinitionIds": [
                    "/providers/microsoft.authorization/roleDefinitions/b24988ac-6180-42a0-ab88-20f7382dd24c"
                  ],
                  "operations": [
                    {
                      "operation": "addOrReplace",
                      "field": "Microsoft.Synapse/workspaces/publicNetworkAccess",
                      "value": "Disabled"
                    }
                  ]
                }
              }
        }
    },
    "id": "/providers/Microsoft.Authorization/policyDefinitions/5c8cad01-ef30-4891-b230-652dadb4876a",
    "name": "5c8cad01-ef30-4891-b230-652dadb4876a"
}