Describe the solution you'd like
At the moment, due to string escape requirement for policyRule, policyDefinitions Templates are generated as parameter file.
It would be great to have policyDefinitions generated as ARM template. Following JQ Template can help with that
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"metadata": {
"_generator": {
"name": "AzOps"
}
},
"parameters": {},
"variables": {},
"resources": [
{
"type": .Type,
"name": .name,
"apiVersion": "2021-06-01",
"properties": {
"description": .properties.description,
"displayName": .properties.displayName,
"metadata": {
"version": .properties.metadata.version,
"category": .properties.metadata.category
},
"mode": .properties.mode,
"parameters": .properties.parameters,
"policyRule": .properties.policyRule | walk(if type == "string" and (.|startswith("[")) then "[" + sub("^\\["; "[") else . end),
"policyType": .properties.policyType
}
}
],
"outputs": {}
}
Describe the solution you'd like
At the moment, due to string escape requirement for policyRule, policyDefinitions Templates are generated as parameter file.
It would be great to have policyDefinitions generated as ARM template. Following JQ Template can help with that