{ "properties": { "displayName": "Do not allow deletion of resource types", "policyType": "BuiltIn", "mode": "All", "description": "This policy enables you to specify the resource types that your organization can protect from accidentals deletion by blocking delete calls using deny action effect.", "metadata": { "version": "1.0.1", "category": "General" }, "version": "1.0.1", "parameters": { "listOfResourceTypesDisallowedForDeletion": { "type": "Array", "metadata": { "displayName": "Resource types that cannot be deleted", "description": "The list of resource types that cannot be deleted.", "strongType": "resourceTypes" } }, "effect": { "type": "String", "metadata": { "displayName": "Effect", "description": "Enable or disable the execution of the policy" }, "allowedValues": [ "DenyAction", "Disabled" ], "defaultValue": "DenyAction" } }, "policyRule": { "if": { "field": "type", "in": "[parameters('listOfResourceTypesDisallowedForDeletion')]" }, "then": { "effect": "[parameters('effect')]", "details": { "actionNames": [ "delete" ] } } }, "versions": [ "1.0.1", "1.0.0-PREVIEW" ] }, "id": "/providers/Microsoft.Authorization/policyDefinitions/78460a36-508a-49a4-b2b2-2f5ec564f4bb", "name": "78460a36-508a-49a4-b2b2-2f5ec564f4bb" }