diff --git a/eslzArm/subscriptionTemplates/avnmPolicy.json b/eslzArm/subscriptionTemplates/avnmPolicy.json index 1402b61e8..ac2465c9b 100644 --- a/eslzArm/subscriptionTemplates/avnmPolicy.json +++ b/eslzArm/subscriptionTemplates/avnmPolicy.json @@ -24,36 +24,36 @@ "resources": [ { "type": "Microsoft.Authorization/policyDefinitions", - "apiVersion": "2021-06-01", - "name": "[uniqueString(resourceId('Microsoft.Network/networkManagers/networkGroups', 'avnm', format('ng-{0}-dynamic', parameters('location'))))]", + "apiVersion": "2023-04-01", + "name": "[uniqueString(variables('networkGroupId'))]", "properties": { "description": "AVNM dynamic group membership Policy", "displayName": "AVNM dynamic group membership Policy", "mode": "Microsoft.Network.Data", "policyRule": { - "if": { - "allof": [ - { - "field": "type", - "equals": "Microsoft.Network/virtualNetworks" - }, - { - "allOf": [ - { - "value": "[resourceGroup().Name]", - "contains": "vnet" - } - ] + "if": { + "allOf": [ + { + "field": "type", + "equals": "Microsoft.Network/virtualNetworks" + }, + { + "allOf": [ + { + "value": "[resourceGroup().Name]", + "contains": "vnet" + } + ] + } + ] + }, + "then": { + "effect": "addToNetworkGroup", + "details": { + "networkGroupId": "[variables('networkGroupId')]" } - ] - }, - "then": { - "effect": "addToNetworkGroup", - "details": { - "networkGroupId": "[variables('networkGroupId')]" } } - } }, "metadata": { "description": "This is a Policy definition for dyanamic group membership" @@ -61,7 +61,7 @@ }, { "type": "Microsoft.Authorization/policyAssignments", - "apiVersion": "2022-06-01", + "apiVersion": "2023-04-01", "name": "[uniqueString(variables('networkGroupId'))]", "properties": { "description": "AVNM dynamic group membership Policy",