diff --git a/src/resources/Microsoft.Authorization/policyDefinitions/Audit-Tags-Mandatory-Rg.json b/src/resources/Microsoft.Authorization/policyDefinitions/Audit-Tags-Mandatory-Rg.json index 39c364624..41c7b41eb 100644 --- a/src/resources/Microsoft.Authorization/policyDefinitions/Audit-Tags-Mandatory-Rg.json +++ b/src/resources/Microsoft.Authorization/policyDefinitions/Audit-Tags-Mandatory-Rg.json @@ -32,52 +32,51 @@ "defaultValue": "Audit" }, "mandatoryTags": { - "type": "Array", - "metadata": { - "displayName": "Array of mandatory tags", - "description": "Array of mandatory tags that must be present on the resource group. The array should contain semicolon separated list of the tag names." - }, - "defaultValue": [] + "type": "Array", + "metadata": { + "displayName": "Array of mandatory tags", + "description": "Array of mandatory tags that must be present on the resource group. The array should contain semicolon separated list of the tag names." + } } }, "policyRule": { "if": { "allOf": [ - { - "field": "type", - "equals": "Microsoft.Resources/subscriptions/resourceGroups" - }, - { - "anyOf": [ - { - "not": { - "count": { - "value": "[[parameters('mandatoryTags')]", - "name": "tagcount", - "where": { - "field": "tags", - "containsKey": "[[current('tagcount')]" - } - }, - "equals": "[[length(parameters('mandatoryTags'))]" + { + "field": "type", + "equals": "Microsoft.Resources/subscriptions/resourceGroups" + }, + { + "anyOf": [ + { + "not": { + "count": { + "value": "[[parameters('mandatoryTags')]", + "name": "tagcount", + "where": { + "field": "tags", + "containsKey": "[[current('tagcount')]" + } + }, + "equals": "[[length(parameters('mandatoryTags'))]" + } + }, + { + "not": { + "count": { + "value": "[[parameters('mandatoryTags')]", + "name": "tagnullcount", + "where": { + "value": "[[resourceGroup().tags[current('tagnullcount')]]", + "notMatch": "" + } + }, + "equals": "[[length(parameters('mandatoryTags'))]" + } } - }, - { - "not": { - "count": { - "value": "[[parameters('mandatoryTags')]", - "name": "tagnullcount", - "where": { - "value": "[[resourceGroup().tags[current('tagnullcount')]]", - "notMatch": "" - } - }, - "equals": "[[length(parameters('mandatoryTags'))]" - } - } - ] - } - ] + ] + } + ] }, "then": { "effect": "[[parameters('effect')]" diff --git a/src/resources/Microsoft.Authorization/policyDefinitions/Audit-Tags-Mandatory.json b/src/resources/Microsoft.Authorization/policyDefinitions/Audit-Tags-Mandatory.json index 3fabcd842..00c6509f1 100644 --- a/src/resources/Microsoft.Authorization/policyDefinitions/Audit-Tags-Mandatory.json +++ b/src/resources/Microsoft.Authorization/policyDefinitions/Audit-Tags-Mandatory.json @@ -32,44 +32,43 @@ "defaultValue": "Audit" }, "mandatoryTags": { - "type": "Array", - "metadata": { - "displayName": "Array of mandatory tags", - "description": "Array of mandatory tags that must be present on the resource group. The array should contain semicolon separated list of the tag names." - }, - "defaultValue": [] + "type": "Array", + "metadata": { + "displayName": "Array of mandatory tags", + "description": "Array of mandatory tags that must be present on the resource group. The array should contain semicolon separated list of the tag names." + } } }, "policyRule": { "if": { "anyOf": [ - { - "not": { - "count": { - "value": "[[parameters('mandatoryTags')]", - "name": "tagcount", - "where": { - "field": "tags", - "containsKey": "[[current('tagcount')]" - } - }, - "equals": "[[length(parameters('mandatoryTags'))]" - } - }, - { - "not": { - "count": { - "value": "[[parameters('mandatoryTags')]", - "name": "tagnullcount", - "where": { - "value": "[[resourceGroup().tags[current('tagnullcount')]]", - "notMatch": "" - } - }, - "equals": "[[length(parameters('mandatoryTags'))]" - } + { + "not": { + "count": { + "value": "[[parameters('mandatoryTags')]", + "name": "tagcount", + "where": { + "field": "tags", + "containsKey": "[[current('tagcount')]" + } + }, + "equals": "[[length(parameters('mandatoryTags'))]" + } + }, + { + "not": { + "count": { + "value": "[[parameters('mandatoryTags')]", + "name": "tagnullcount", + "where": { + "value": "[[resourceGroup().tags[current('tagnullcount')]]", + "notMatch": "" + } + }, + "equals": "[[length(parameters('mandatoryTags'))]" } - ] + } + ] }, "then": { "effect": "[[parameters('effect')]"