Support for more complex expressions #1033
BernieWhite
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently expressions support comparing any
field
,name
, ortype
of an object with a predefined set of comparison expressions such asequals
,contains
,greater
...While this handles many cases, advanced use cases may need to revert to PowerShell-based rules.
With PSRule for Azure, we would like to provide a mechanism to generate rules from Azure Policy.
Consider the following Azure Policy code samples from docs:
Example 1
This could be expressed as a rule such as the following. Currently
less
orcount
conditions do not count the properties oftags
so this would not work. However this could be added.Example 2
This one is a little more tricky, there isn't a PSRule option, the closest approximation would be the following.
The ARM option of using a embedded syntax such as
"[function()]"
is not ideal, part of which is the reason for Azure Bicep. An embedded syntax is hard for authors and has a steep learning curve.Without developing a new language such as Bicep we want to make using complex expressions easier by taking advantage of existing schema support.
For example:
Beta Was this translation helpful? Give feedback.
All reactions