Exempt - Azure CSPM Recommenda... Note

Exempt - Azure CSPM Recommendation" (Terraform exemption

The reason a standalone policyAssignmentId or policyDefinitionId isn't found for this recommendation is because it's part of a larger built-in initiative. This specific control resides within the "ASC Default" or Microsoft Cloud Security Benchmark initiative assignment. To exempt a resource from this control, you need to target the initiative assignment ID. Furthermore, you must specify the individual control to be exempted using its policy definition reference ID.In Terraform's azurerm_resource_policy_exemption, the policy_assignment_id should point to the initiative's ID. The policy_definition_reference_ids field takes an array to scope the exemption to the specific control. Finding this reference ID involves searching for the recommendation's definition in the Azure Portal and then locating its corresponding entry within the initiative's policyDefinitions array.Before automating, decide on the exemption category: "Waiver" for accepted risk, or "Mitigated" if an equivalent control is in place. Also, consider the scope of the exemption. Applying it at the resource level is generally safer, but for multiple similar resources, using a tag-based resourceSelectors block can offer scalability. This approach avoids creating individual exemption blocks for each resource.