[BUG] Policy as rules compatibility with Az.Resources v7.x
Closed this issue · 0 comments
BernieWhite commented
Existing rule
No response
Description of the issue
Updates to Az.Resources
in v7.x have introduced a breaking change that is not compatible with the Export-AzPolicyAssignmentData
implementation.
We should rollback to v6.7.0 and update docs to reflect the issue until dependency on this module can be removed.
Error messages
ExpandPolicyAssignment: The property 'Properties' cannot be found on this object. Verify that the property exists.
Reproduction
- Install v7.1.0 of Az.Resources.
- Run
Export-AzPolicyAssignmentData
.
Version of PSRule
2.9.0
Version of PSRule for Azure
1.27.0
Additional context
To work around this issue use Az.Resource v6.x. If multiple versions of Az.Resources
are installed, specifically import the required version before running PSRule to prevent the latest version from being automatically imported.
For example:
Install-Module Az.Resource -RequiredVersion 6.7.0
Import-Module Az.Resources -RequiredVersion 6.7.0
Export-AzPolicyAssignmentData