Azure Policy support (Experimental) #1345
BernieWhite
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Updated 2023-08-08
We've started work on a new feature, Azure Policy support for PSRule for Azure - policy as rules.
Azure Policy support will allow you to use your existing Azure Policies to generate custom rules you can use to test your infrastructure as code before deployment to Azure.
This feature is still early in it's lifecycle and we have still a lot more to do. However we wanted to share an early version and where we are up to:
Some key points:
How to get started
Export assignment data
Run
Export-AzPolicyAssignmentData
to export assignments from Azure to an*.assignment.json
file.Key points:
Az
PowerShell module and usingConnect-AzAccount
.Set-AzContext
.Convert assignments to rules
Run
Export-AzPolicyAssignmentRuleData
to convert assignments to rules. To run this command an-AssignmentFile
parameter with the path to the assignment JSON file generated in the previous step.After the command completes a new file
*.Rule.jsonc
should be generated containing generated rules.If you try this feature we'd love to hear your feedback and issues.
Beta Was this translation helpful? Give feedback.
All reactions