Skip to content

Commit 05329df

Browse files
Merge pull request #265045 from shanhix1/shannon/param
Clarified parameter deprecation concept
2 parents f20b983 + 0f4d50e commit 05329df

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

articles/governance/policy/concepts/definition-structure.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,13 @@ always stay the same, however their values change based on the individual fillin
186186
Parameters work the same way when building policies. By including parameters in a policy definition,
187187
you can reuse that policy for different scenarios by using different values.
188188

189+
### Adding or removing parameters
190+
189191
Parameters may be added to an existing and assigned definition. The new parameter must include the
190192
**defaultValue** property. This prevents existing assignments of the policy or initiative from
191193
indirectly being made invalid.
192194

193-
Parameters can't be removed from a policy definition because there may be an assignment that sets the parameter value, and that reference would become broken. Instead of removing, you can classify the parameter as deprecated in the parameter metadata.
195+
Parameters can't be removed from a policy definition because there may be an assignment that sets the parameter value, and that reference would become broken. Some built-in policy definitions have deprecated parameters using metadata `"deprecated": true`, which hides the parameter when assigning the definition in Azure Portal. While this is not supported for custom policy definitions, another option is to duplicate and create a new custom policy definition without the parameter.
194196

195197
### Parameter properties
196198

@@ -212,6 +214,7 @@ A parameter has the following properties that are used in the policy definition:
212214
the assignment scope. There's one role assignment per role definition in the policy (or per role
213215
definition in all of the policies in the initiative). The parameter value must be a valid
214216
resource or scope.
217+
- `deprecated`: A boolean flag to indicate whether a parameter is deprecated in a built-in definition.
215218
- `defaultValue`: (Optional) Sets the value of the parameter in an assignment if no value is given. Required when updating an existing policy definition that is assigned. For oject-type parameters, the value must match the appropriate schema.
216219
- `allowedValues`: (Optional) Provides an array of values that the parameter accepts during
217220
assignment.

0 commit comments

Comments
 (0)