-
Notifications
You must be signed in to change notification settings - Fork 0
/
Required Tags Azure Policy Modify Effect.json
175 lines (175 loc) · 5.54 KB
/
Required Tags Azure Policy Modify Effect.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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
{
"mode": "All",
"policyRule": {
"if": {
"allOf": [
{
"field": "[concat('tags[',parameters('Tag-Application'), ']')]",
"exists": "false"
},
{
"field": "[concat('tags[',parameters('Tag-Environment'), ']')]",
"exists": "false"
},
{
"field": "[concat('tags[',parameters('Tag-Created-By'), ']')]",
"exists": "false"
},
{
"field": "[concat('tags[',parameters('Tag-Date-Created'), ']')]",
"exists": "false"
},
{
"field": "[concat('tags[',parameters('Tag-Department'), ']')]",
"exists": "false"
},
{
"field": "[concat('tags[',parameters('Tag-Owner'), ']')]",
"exists": "false"
},
{
"field": "type",
"equals": "Microsoft.Resources/subscriptions/resourceGroups"
}
]
},
"then": {
"effect": "modify",
"details": {
"roleDefinitionIds": [
"/providers/Microsoft.Authorization/roleDefinitions/b24988ac-6180-42a0-ab88-20f7382dd24c"
],
"operations": [
{
"operation": "addOrReplace",
"field": "[concat('tags[', parameters('Tag-Application'), ']')]",
"value": "[parameters('Value-Application')]"
},
{
"operation": "addOrReplace",
"field": "[concat('tags[', parameters('Tag-Environment'), ']')]",
"value": "[parameters('Value-Environment')]"
},
{
"operation": "addOrReplace",
"field": "[concat('tags[', parameters('Tag-Created-By'), ']')]",
"value": "[parameters('Value-Created-By')]"
},
{
"operation": "addOrReplace",
"field": "[concat('tags[', parameters('Tag-Date-Created'), ']')]",
"value": "[parameters('Value-Date-Created')]"
},
{
"operation": "addOrReplace",
"field": "[concat('tags[', parameters('Tag-Department'), ']')]",
"value": "[parameters('Value-Department')]"
},
{
"operation": "addOrReplace",
"field": "[concat('tags[', parameters('Tag-Owner'), ']')]",
"value": "[parameters('Value-Owner')]"
}
]
}
}
},
"parameters": {
"Tag-Application": {
"type": "String",
"metadata": {
"displayName": "Tag-Application",
"description": "Enter the application this resource belongs to."
},
"defaultValue": "Application"
},
"Value-Application": {
"type": "String",
"metadata": {
"displayName": "Value-Application",
"description": "Enter the application this resource belongs to."
},
"defaultValue": "Application"
},
"Tag-Environment": {
"type": "String",
"metadata": {
"displayName": "Tag-Environment",
"description": "Enter the environment this resource belongs to (i.e. dev, prod etc.)."
},
"defaultValue": "Environment"
},
"Value-Environment": {
"type": "String",
"metadata": {
"displayName": "Value-Environment",
"description": "Enter the environment this resource belongs to (i.e. dev, prod etc.)."
},
"defaultValue": "Enter the environment this resource belongs to (i.e. dev, prod etc.)."
},
"Tag-Created-By": {
"type": "String",
"metadata": {
"displayName": "Tag-Created-By",
"description": "Name of the person who created this resource."
},
"defaultValue": "Created-By"
},
"Value-Created-By": {
"type": "String",
"metadata": {
"displayName": "Value-Created-By",
"description": "Name of the person who created this resource."
},
"defaultValue": "Enter the name of the person who created this resource."
},
"Tag-Date-Created": {
"type": "String",
"metadata": {
"displayName": "Tag-Date-Created",
"description": "Date on which this resource was created."
},
"defaultValue": "Date-Created"
},
"Value-Date-Created": {
"type": "String",
"metadata": {
"displayName": "Value-Date-Created",
"description": "Date on which this resource was created."
},
"defaultValue": "Enter the date on which this resource was created."
},
"Tag-Department": {
"type": "String",
"metadata": {
"displayName": "Tag-Department",
"description": "The department this resource belongs to."
},
"defaultValue": "Department"
},
"Value-Department": {
"type": "String",
"metadata": {
"displayName": "Value-Department",
"description": "The department this resource belongs to."
},
"defaultValue": "Enter the department this resource belongs to."
},
"Tag-Owner": {
"type": "String",
"metadata": {
"displayName": "Tag-Owner",
"description": "Enter the owner of this resource."
},
"defaultValue": "Owner"
},
"Value-Owner": {
"type": "String",
"metadata": {
"displayName": "Value-Owner",
"description": "Enter the owner of this resource."
},
"defaultValue": "Enter the owner of this resource."
}
}
}