-
Notifications
You must be signed in to change notification settings - Fork 14
/
naming-convention-ntfns.json
129 lines (129 loc) · 4.05 KB
/
naming-convention-ntfns.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
{
"$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.4.613.9944",
"templateHash": "8068055719184682257"
}
},
"functions": [],
"resources": [
{
"type": "Microsoft.Resources/deployments",
"apiVersion": "2019-10-01",
"name": "policy-naming-convention-ntfns",
"location": "[deployment().location]",
"properties": {
"expressionEvaluationOptions": {
"scope": "inner"
},
"mode": "Incremental",
"parameters": {
"pattern": {
"value": "ntfs-*"
},
"policyName": {
"value": "policy-naming-convention-ntfns"
},
"assignmentName": {
"value": "assignment-naming-convention-ntfns"
},
"type": {
"value": "Microsoft.NotificationHubs/namespaces"
}
},
"template": {
"$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.4.613.9944",
"templateHash": "1962347804019361325"
}
},
"parameters": {
"pattern": {
"type": "string"
},
"policyName": {
"type": "string"
},
"assignmentName": {
"type": "string"
},
"type": {
"type": "string"
},
"effect": {
"type": "string",
"defaultValue": "Deny",
"metadata": {
"description": "The effect determines what happens when the policy rule is evaluated to match"
},
"allowedValues": [
"Deny",
"Audit",
"Disabled"
]
},
"enforcementMode": {
"type": "string",
"defaultValue": "Default",
"metadata": {
"description": "When enforcement mode is disabled, the policy effect isn't enforced (i.e. deny policy won't deny resources). Compliance assessment results are still available."
},
"allowedValues": [
"Default",
"DoNotEnforce"
]
}
},
"functions": [],
"resources": [
{
"type": "Microsoft.Authorization/policyDefinitions",
"apiVersion": "2020-03-01",
"name": "[parameters('policyName')]",
"properties": {
"policyType": "Custom",
"mode": "All",
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "[parameters('type')]"
},
{
"field": "name",
"notLike": "[parameters('pattern')]"
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
}
}
},
{
"type": "Microsoft.Authorization/policyAssignments",
"apiVersion": "2020-03-01",
"name": "[parameters('assignmentName')]",
"properties": {
"policyDefinitionId": "[subscriptionResourceId('Microsoft.Authorization/policyDefinitions', parameters('policyName'))]",
"enforcementMode": "[parameters('enforcementMode')]"
},
"dependsOn": [
"[subscriptionResourceId('Microsoft.Authorization/policyDefinitions', parameters('policyName'))]"
]
}
]
}
}
}
]
}