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/concepts/definition-structure.md
+12-6Lines changed: 12 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -692,18 +692,24 @@ use within a policy rule, except the following functions and user-defined functi
692
692
The following functions are available to use in a policy rule, but differ from use in an Azure
693
693
Resource Manager template:
694
694
695
-
- addDays(dateTime, numberOfDaysToAdd)
695
+
-`addDays(dateTime, numberOfDaysToAdd)`
696
696
-**dateTime**: [Required] string - String in the Universal ISO 8601 DateTime format
697
697
'yyyy-MM-ddTHH:mm:ss.fffffffZ'
698
698
-**numberOfDaysToAdd**: [Required] integer - Number of days to add
699
-
- utcNow() - Unlike a Resource Manager template, this can be used outside defaultValue.
699
+
-`utcNow()` - Unlike a Resource Manager template, this can be used outside defaultValue.
700
700
- Returns a string that is set to the current date and time in Universal ISO 8601 DateTime format
701
701
'yyyy-MM-ddTHH:mm:ss.fffffffZ'
702
702
703
-
Additionally, the `field` function is available to policy rules. `field` is primarily used with
704
-
**AuditIfNotExists** and **DeployIfNotExists** to reference fields on the resource that are being
705
-
evaluated. An example of this use can be seen in the [DeployIfNotExists
706
-
example](effects.md#deployifnotexists-example).
703
+
The following functions are only available in policy rules:
704
+
705
+
-`field(fieldName)`
706
+
-**fieldName**: [Required] string - Name of the [field](#fields) to retrieve
707
+
- Returns the value of that field from the resource that is being evaluated by the If condition
708
+
-`field` is primarily used with **AuditIfNotExists** and **DeployIfNotExists** to reference fields on the resource that are being evaluated. An example of this use can be seen in the [DeployIfNotExists example](effects.md#deployifnotexists-example).
709
+
-`requestContext().apiVersion`
710
+
- Returns the API version of the request that triggered policy evaluation (example: `2019-09-01`). This will be the API version that was used in the PUT/PATCH request for evaluations on resource creation/update. The latest API version is always used during compliance evaluation on existing resources.
0 commit comments