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

[BUG] Policy as rules compatibility with Az.Resources v7.x #2970

Closed
BernieWhite opened this issue Jul 3, 2024 · 0 comments · Fixed by #2974
Closed

[BUG] Policy as rules compatibility with Az.Resources v7.x #2970

BernieWhite opened this issue Jul 3, 2024 · 0 comments · Fixed by #2974
Assignees
Labels
bug Something isn't working feature: policy-as-rules Issues that related to exporting policy as rules.
Milestone

Comments

@BernieWhite
Copy link
Collaborator

BernieWhite commented Jul 3, 2024

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
@BernieWhite BernieWhite added bug Something isn't working feature: policy-as-rules Issues that related to exporting policy as rules. labels Jul 3, 2024
@BernieWhite BernieWhite added this to the v1.38.0 milestone Jul 3, 2024
@BernieWhite BernieWhite changed the title [BUG] Rollback to Az.Resources v6.7.0 [BUG] Policy as rules compatiblity with Az.Resources v7.x Jul 3, 2024
@BernieWhite BernieWhite changed the title [BUG] Policy as rules compatiblity with Az.Resources v7.x [BUG] Policy as rules compatibility with Az.Resources v7.x Jul 3, 2024
@BernieWhite BernieWhite pinned this issue Jul 3, 2024
BernieWhite added a commit to BernieWhite/PSRule.Rules.Azure that referenced this issue Jul 6, 2024
@BernieWhite BernieWhite self-assigned this Jul 6, 2024
BernieWhite added a commit that referenced this issue Jul 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature: policy-as-rules Issues that related to exporting policy as rules.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant