Azure / enterprise-azure-policy-as-code

Enterprise-ready Azure Policy-as-Code (PaC) solution (includes Az DevOps pipeline)
https://azure.github.io/enterprise-azure-policy-as-code/
MIT License
415 stars 219 forks source link

Failed exemption deployments do not throw errors #706

Closed robsissons-contino closed 1 month ago

robsissons-contino commented 1 month ago

Describe the bug When deploying exemptions, if a scope is not found a warning is thrown rather than an error. This means a deploy pipeline will not fail so the end user has no visibility of the failure to deploy the exemption without reviewing the logs in detail.

To Reproduce Steps to reproduce the behavior:

Perform a deployment with an exemption which has a typo/mis-spelled scope.

(note - "skipResourceValidationForExemptions" is set to 'true' in global settings for the environment due to amount of exemptions in environment to speed up build time)

Expected behavior A clear and concise description of what you expected to happen.

I would expect that, if a resource (in this case an exemption) that was intended to be deployed and failed, the pipeline result would reflect the failure.

Screenshots fail_warning

Warning comes from the "Set-AzPolicyExemptionsRestMethod" function, line 42.

EPAC Version 10.3.1

apybar commented 1 month ago

I've assigned this to myself @robsissons-contino - Looking into it.

apybar commented 1 month ago

Will be fixed in v10.5.1

apybar commented 1 month ago

Fixed in v10.5.1