You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/governance/policy/how-to/policy-safe-deployment-practices.md
+19-28Lines changed: 19 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,19 +7,11 @@ ms.topic: conceptual
7
7
8
8
# Safe deployment of Azure Policy assignments
9
9
10
-
As your environment expands, so does the demand for a controlled continuous deployment (CD)
11
-
pipeline with progressive exposure control. Accordingly, Microsoft recommends DevOps teams follow
12
-
the safe deployment practices (SDP) framework. The
13
-
safe deployment of Azure Policy definitions and assignments helps limiting the impact of
14
-
unintended behaviors of policy resources.
10
+
As your environment expands, so does the demand for a controlled continuous deployment (CD) pipeline with progressive exposure control. Accordingly, Microsoft recommends DevOps teams follow the safe deployment practices (SDP) framework. The safe deployment of Azure Policy definitions and assignments helps limiting the impact of unintended behaviors of policy resources.
15
11
16
-
The high-level approach of implementing SDP with Azure Policy is to gradually rollout policy assignments
17
-
by rings to detect policy changes that affect the environment in early stages before it
18
-
affects the critical cloud infrastructure.
12
+
The high-level approach of implementing SDP with Azure Policy is to gradually rollout policy assignments by tiers to detect policy changes that affect the environment in early stages before it affects the critical cloud infrastructure.
19
13
20
-
Deployment rings can be organized in diverse ways. In this how-to tutorial, rings are divided by
21
-
different Azure regions with _Ring 0_ representing non-critical, low traffic locations,
22
-
and _Ring 5_ denoting the most critical, highest traffic locations.
14
+
Deployment tiers can be organized in diverse ways. In this how-to tutorial, tiers are divided by different Azure regions with _Tier 5_ representing non-critical, low traffic locations, and _Tier 0_ denoting the most critical, highest traffic locations.
23
15
24
16
## Steps for safe deployment of Azure Policy assignments with deny or append effects
25
17
@@ -34,8 +26,8 @@ Policy assignments that use the `deny` or `append` policy effects.
34
26
Flowchart step numbers:
35
27
36
28
1. Once you've selected your policy definition, assign the policy at the highest-level scope inclusive
37
-
of all deployment rings. Apply _resource selectors_ to narrow the applicability to the least
38
-
critical ring by using the `"kind": "resource location"` property. Configure the `audit` effect type
29
+
of all deployment tiers. Apply _resource selectors_ to narrow the applicability to the least
30
+
critical tier by using the `"kind": "resource location"` property. Configure the `audit` effect type
39
31
by using _assignment overrides_. Sample selector with `eastUS` location and effect as `audit`:
40
32
41
33
```json
@@ -69,7 +61,7 @@ validate that the compliance result is as expected.
69
61
and impact of the policy. If the results aren't as expected due to application configuration,
70
62
refactor the application as appropriate.
71
63
72
-
3. Repeat by expanding the resource selector property values to include the next rings.
64
+
3. Repeat by expanding the resource selector property values to include the next tiers.
73
65
locations and validating the expected compliance results and application health. Example selector with an added location value:
74
66
75
67
```json
@@ -82,9 +74,9 @@ locations and validating the expected compliance results and application health.
82
74
}]
83
75
```
84
76
85
-
4. Once you have successfully assigned the policy to all rings using `audit` mode,
77
+
4. Once you have successfully assigned the policy to all tiers using `audit` mode,
86
78
the pipeline should trigger a task that changes the policy effect to `deny` and reset
87
-
the resource selectors to the location associated with _Ring 0_. Example selector with one region and effect set to deny:
79
+
the resource selectors to the location associated with _Tier 0_. Example selector with one region and effect set to deny:
88
80
89
81
```json
90
82
"resourceSelectors": [{
@@ -103,9 +95,9 @@ the resource selectors to the location associated with _Ring 0_. Example selecto
103
95
5. Once the effect is changed, automated tests should check whether enforcement is taking place as
104
96
expected.
105
97
106
-
6. Repeat by including more rings in your resource selector configuration.
98
+
6. Repeat by including more tiers in your resource selector configuration.
107
99
108
-
7. Repeat this process for all production rings.
100
+
7. Repeat this process for all production tiers.
109
101
110
102
## Steps for safe deployment of Azure Policy assignments with modify or deployIfNotExists effects
111
103
@@ -117,8 +109,8 @@ Review the following flowchart with modified steps 5-9:
117
109
Flowchart step numbers:
118
110
119
111
1. Once you've selected your policy definition, assign the policy at the highest-level scope inclusive
120
-
of all deployment rings. Apply _resource selectors_ to narrow the applicability to the least
121
-
critical ring by using the `"kind": "resource location"` property. Configure the _enforcement mode_ of the assignment to _DoNotEnforce_. Sample selector with `eastUS` location and _enforcementMode_ as _DoNotEnforce_:
112
+
of all deployment tiers. Apply _resource selectors_ to narrow the applicability to the least
113
+
critical tier by using the `"kind": "resource location"` property. Configure the _enforcement mode_ of the assignment to _DoNotEnforce_. Sample selector with `eastUS` location and _enforcementMode_ as _DoNotEnforce_:
122
114
123
115
```json
124
116
"resourceSelectors": [{
@@ -150,8 +142,7 @@ validate that the compliance result is as expected.
150
142
151
143
You may also [trigger remediation tasks](../how-to/remediate-resources.md) to remediate existing non-compliant resources. Ensure the remediation tasks are bringing resources into compliance as expected.
152
144
153
-
3. Repeat by expanding the resource selector property values to include the next ring's
154
-
locations and validating the expected compliance results and application health. Example selector with an added location value:
145
+
3. Repeat by expanding the resource selector property values to include the next tier's locations and validating the expected compliance results and application health. Example selector with an added location value:
155
146
156
147
```json
157
148
"resourceSelectors": [{
@@ -163,9 +154,9 @@ locations and validating the expected compliance results and application health.
163
154
}]
164
155
```
165
156
166
-
4. Once you have successfully assigned the policy to all rings using _DoNotEnforce_ mode,
157
+
4. Once you have successfully assigned the policy to all tiers using _DoNotEnforce_ mode,
167
158
the pipeline should trigger a task that changes the policy `enforcementMode` to _Default_ enablement and reset
168
-
the resource selectors to the location associated with _Ring 0_. Example selector with one region and effect set to deny:
159
+
the resource selectors to the location associated with _Tier 0_. Example selector with one region and effect set to deny:
169
160
170
161
```json
171
162
"resourceSelectors": [{
@@ -181,14 +172,14 @@ the resource selectors to the location associated with _Ring 0_. Example selecto
181
172
5. Once the effect is changed, automated tests should check whether enforcement is taking place as
182
173
expected.
183
174
184
-
6. Repeat by including more rings in your resource selector configuration.
175
+
6. Repeat by including more tiers in your resource selector configuration.
185
176
186
-
7. Repeat this process for all production rings.
177
+
7. Repeat this process for all production tiers.
187
178
188
179
## Steps for safely updating built-in definition version within Azure Policy assignment
189
180
190
181
1. Within the existing assignment, apply _overrides_ to update the version of the definition for the least
191
-
critical ring. We're using a combination of _overrides_ to change the definitionVersion and _selectors_ within the _overrides_ condition to narrow the applicability by `"kind": "resource location"` property. Any resources that are outside of the locations specified will continue to be assessed against the version from the `definitionVersion` top-level property in the assignment. Example override updating the version of the definition to `2.0.*` and only apply it to resources in `EastUs`.
182
+
critical tier. We're using a combination of _overrides_ to change the definitionVersion and _selectors_ within the _overrides_ condition to narrow the applicability by `"kind": "resource location"` property. Any resources that are outside of the locations specified will continue to be assessed against the version from the `definitionVersion` top-level property in the assignment. Example override updating the version of the definition to `2.0.*` and only apply it to resources in `EastUs`.
192
183
193
184
```json
194
185
"overrides":[{
@@ -218,7 +209,7 @@ validate that the compliance result is as expected.
218
209
and impact of the policy. If the results aren't as expected due to application configuration,
219
210
refactor the application as appropriate.
220
211
221
-
3. Repeat by expanding the resource selector property values to include the next rings.
212
+
3. Repeat by expanding the resource selector property values to include the next tiers.
222
213
locations and validating the expected compliance results and application health. Example with an added location value:
0 commit comments