Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plan does not catch missing nonComplianceMessage\policyDefinitionReferenceId in policyAssignments #753

Closed
o-l-a-v opened this issue Sep 24, 2024 · 1 comment · Fixed by #763
Assignees
Labels
bug Something isn't working

Comments

@o-l-a-v
Copy link
Contributor

o-l-a-v commented Sep 24, 2024

Describe the bug

Plan does not validate/catch missing/non-existing nonComplianceMessage\policyDefinitionReferenceId in policyAssignments.

Deploy then crashes when EPAC calls Set-AzPolicyAssignmentRestMethod with error:

{
  "error": {
    "code": "InvalidCreatePolicyAssignmentRequest",
    "message": "The policy assignment request is invalid. The following policy definition reference IDs used in non-compliance messages do not exist in the assigned policy set definition: '<redacted>'."
  }
}

Would be great if EPAC could validate this during plan.

To Reproduce

In a policyAssignments: Create a nonComplianceMessage with policyDefinitionReferenceId to a policyDefinition or a policySetDefinition that does not exist.

Expected behavior

Catch this in plan.

Screenshots

No thanks.

EPAC Version

v10.6.0

@o-l-a-v o-l-a-v added the bug Something isn't working label Sep 24, 2024
@anwather anwather self-assigned this Sep 30, 2024
@anwather
Copy link
Collaborator

Testing in development environment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants