From 567dc8eeb283e3c1109354025e1d6b2d9e9b485e Mon Sep 17 00:00:00 2001 From: msftkenneth <39583715+msftkenneth@users.noreply.github.com> Date: Wed, 19 Aug 2020 07:21:43 +0800 Subject: [PATCH] Add sourceAddressPrefixes to the Resource section (#164) It is probably missed to add the suggested line to cater multiple values in array form for the source address prefixes. --- Modules/NetworkSecurityGroups/deploy.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Modules/NetworkSecurityGroups/deploy.json b/Modules/NetworkSecurityGroups/deploy.json index 5ecf3cf..f1b526c 100644 --- a/Modules/NetworkSecurityGroups/deploy.json +++ b/Modules/NetworkSecurityGroups/deploy.json @@ -64,6 +64,7 @@ "priority": "[int(parameters('networkSecurityGroupSecurityRules')[copyIndex('securityRules')].properties.priority)]", "protocol": "[parameters('networkSecurityGroupSecurityRules')[copyIndex('securityRules')].properties.protocol]", "sourceAddressPrefix": "[if(equals(parameters('networkSecurityGroupSecurityRules')[copyIndex('securityRules')].properties.sourceAddressPrefix, ''), json('null'), parameters('networkSecurityGroupSecurityRules')[copyIndex('securityRules')].properties.sourceAddressPrefix)]", + "sourceAddressPrefixes": "[if(equals(length(parameters('networkSecurityGroupSecurityRules')[copyIndex('securityRules')].properties.sourceAddressPrefixes), 0), json('null'), parameters('networkSecurityGroupSecurityRules')[copyIndex('securityRules')].properties.sourceAddressPrefixes)]", "sourceApplicationSecurityGroups": "[if(equals(length(parameters('networkSecurityGroupSecurityRules')[copyIndex('securityRules')].properties.sourceApplicationSecurityGroups), 0), json('null'), concat(variables('emptyArray'), array(json(concat('{\"id\": \"', resourceId('Microsoft.Network/applicationSecurityGroups', parameters('networkSecurityGroupSecurityRules')[copyIndex('securityRules')].properties.sourceApplicationSecurityGroups[0].name), '\"', ',', '\"location\": \"', resourceGroup().location, '\"}')))))]", "sourcePortRanges": "[if(equals(length(parameters('networkSecurityGroupSecurityRules')[copyIndex('securityRules')].properties.sourcePortRanges), 0), json('null'), parameters('networkSecurityGroupSecurityRules')[copyIndex('securityRules')].properties.sourcePortRanges)]", "sourcePortRange": "[parameters('networkSecurityGroupSecurityRules')[copyIndex('securityRules')].properties.sourcePortRange]" @@ -129,4 +130,4 @@ } } } -} \ No newline at end of file +}