-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
ResourceType_denyActionDelete.json
55 lines (55 loc) · 1.55 KB
/
ResourceType_denyActionDelete.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
{
"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"
}