Closed BartDecker closed 1 year ago
Can you share a bit more of the code you would like to write that is not working today? Bicep/ARM Templates does not have a count()
function like policy, but depending on what you are trying to achieve, there may be a workaround.
@alex-frankel I solved it by using the built-in policy definition. My question was also asked in the wrong way. I was looking to get the policy rule within the Bicep template, but used the built in policy instead of it (only passing parameters to he policy via the bicep template)
Is there such a thing as a count operator (for policy rules) in Bicep?
Such as described here for ARM -> https://learn.microsoft.com/en-us/azure/governance/policy/samples/pattern-count-operator
I'm trying to put the deployment of the following policy definition in a bicep template -> /providers/Microsoft.Authorization/policyDefinitions/ffb6f416-7bd2-4488-8828-56585fef2be9 / Enable export to Log Analytics workspace of Microsoft Defender for Cloud data.
But have a hard time in bringing the policy rule logic related to the existence condition to a bicep template.