Question 38 — AZ-104 Case Study Set
Paideffort needs a policy-rule function that returns the value of a property on the resource currently being evaluated, particularly for scenarios involving auditIfNotExists or deployIfNotExists. The appropriate function is [Gap 1].
- field
- requestContext
- policy
- addDays
- current
Correct answers
- Gap 1: field
Explanations
Correct Answer:
field
Explanation:
Paideffort's related-resource policies may need information from the resource that triggered evaluation. The field() policy function retrieves the value of a specified field from the evaluated resource and is particularly useful with auditIfNotExists and deployIfNotExists.
Wrong Answers:
policy
policy() returns information about the policy evaluation context, such as assignment and definition identifiers. It does not retrieve the evaluated resource property Paideffort needs.
current
current() is used inside count expressions to access the array member currently being evaluated. It is not the general function for retrieving a resource field.
addDays
addDays() performs date arithmetic and does not retrieve properties from Paideffort's evaluated resource.
requestContext
requestContext().apiVersion returns the API version associated with the policy evaluation request. It does not return an arbitrary resource property.