From 8d9f6674e16b94216abc219160e1137f2b53b22f Mon Sep 17 00:00:00 2001 From: Russ Cam Date: Mon, 17 Jun 2019 10:02:04 +1000 Subject: [PATCH] Update usage pattern of resourceId() This commit updates the usage pattern of resourceId() function to remove the usage of concat(). The resourceId() function can accept multiple resourceNames and a path to a resource that do not require a path to be concatenated. --- src/loadbalancers/external-lb-resources.json | 18 +++++++++--------- src/loadbalancers/internal-lb-resources.json | 12 ++++++------ ...standard-application-gateway-resources.json | 18 +++++++++--------- .../waf-application-gateway-resources.json | 16 ++++++++-------- src/machines/jumpbox-resources.json | 6 +++--- src/machines/kibana-resources.json | 2 +- src/machines/logstash-resources.json | 2 +- src/mainTemplate.json | 10 +++++----- 8 files changed, 42 insertions(+), 42 deletions(-) diff --git a/src/loadbalancers/external-lb-resources.json b/src/loadbalancers/external-lb-resources.json index e326ee6b..ecb60b68 100644 --- a/src/loadbalancers/external-lb-resources.json +++ b/src/loadbalancers/external-lb-resources.json @@ -49,7 +49,7 @@ "name": "LBFE", "properties": { "subnet": { - "id": "[concat(resourceId(parameters('networkSettings').resourceGroup, 'Microsoft.Network/virtualNetworks',parameters('networkSettings').name), '/subnets/', parameters('networkSettings').subnet.name)]" + "id": "[resourceId(parameters('networkSettings').resourceGroup, 'Microsoft.Network/virtualNetworks/subnets', parameters('networkSettings').name, parameters('networkSettings').subnet.name)]" }, "privateIPAddress": "[parameters('networkSettings').subnet.loadBalancerIp]", "privateIPAllocationMethod": "Static" @@ -66,10 +66,10 @@ "name": "es-http-internal", "properties": { "frontendIPConfiguration": { - "id": "[concat(resourceId('Microsoft.Network/loadBalancers',variables('internalLoadBalancerName')),'/frontendIPConfigurations/LBFE')]" + "id": "[resourceId('Microsoft.Network/loadBalancers/frontendIPConfigurations', variables('internalLoadBalancerName'), 'LBFE')]" }, "backendAddressPool": { - "id": "[concat(resourceId('Microsoft.Network/loadBalancers',variables('internalLoadBalancerName')),'/backendAddressPools/LBBE')]" + "id": "[resourceId('Microsoft.Network/loadBalancers/backendAddressPools', variables('internalLoadBalancerName'), 'LBBE')]" }, "protocol": "Tcp", "frontendPort": 9200, @@ -77,7 +77,7 @@ "enableFloatingIP": false, "idleTimeoutInMinutes": 5, "probe": { - "id": "[concat(resourceId('Microsoft.Network/loadBalancers',variables('internalLoadBalancerName')),'/probes/es-probe-internal-http')]" + "id": "[resourceId('Microsoft.Network/loadBalancers/probes', variables('internalLoadBalancerName'), 'es-probe-internal-http')]" } } }, @@ -85,10 +85,10 @@ "name": "es-transport-internal", "properties": { "frontendIPConfiguration": { - "id": "[concat(resourceId('Microsoft.Network/loadBalancers',variables('internalLoadBalancerName')),'/frontendIPConfigurations/LBFE')]" + "id": "[resourceId('Microsoft.Network/loadBalancers/frontendIPConfigurations', variables('internalLoadBalancerName'), 'LBFE')]" }, "backendAddressPool": { - "id": "[concat(resourceId('Microsoft.Network/loadBalancers',variables('internalLoadBalancerName')),'/backendAddressPools/LBBE')]" + "id": "[resourceId('Microsoft.Network/loadBalancers/backendAddressPools', variables('internalLoadBalancerName'), 'LBBE')]" }, "protocol": "Tcp", "frontendPort": 9300, @@ -158,10 +158,10 @@ "name": "es-http-external", "properties": { "frontendIPConfiguration": { - "id": "[concat(resourceId('Microsoft.Network/loadBalancers',variables('externalLoadBalancerName')),'/frontendIPConfigurations/LBFE')]" + "id": "[resourceId('Microsoft.Network/loadBalancers/frontendIPConfigurations', variables('externalLoadBalancerName'), 'LBFE')]" }, "backendAddressPool": { - "id": "[concat(resourceId('Microsoft.Network/loadBalancers',variables('externalLoadBalancerName')),'/backendAddressPools/LBBE')]" + "id": "[resourceId('Microsoft.Network/loadBalancers/backendAddressPools', variables('externalLoadBalancerName'), 'LBBE')]" }, "protocol": "Tcp", "frontendPort": 9200, @@ -169,7 +169,7 @@ "enableFloatingIP": false, "idleTimeoutInMinutes": 5, "probe": { - "id": "[concat(resourceId('Microsoft.Network/loadBalancers',variables('externalLoadBalancerName')),'/probes/es-http-external-probe')]" + "id": "[resourceId('Microsoft.Network/loadBalancers/probes', variables('externalLoadBalancerName'), 'es-http-external-probe')]" } } } diff --git a/src/loadbalancers/internal-lb-resources.json b/src/loadbalancers/internal-lb-resources.json index b79102a2..8c971139 100644 --- a/src/loadbalancers/internal-lb-resources.json +++ b/src/loadbalancers/internal-lb-resources.json @@ -42,7 +42,7 @@ "name": "LBFE", "properties": { "subnet": { - "id": "[concat(resourceId(parameters('networkSettings').resourceGroup, 'Microsoft.Network/virtualNetworks',parameters('networkSettings').name), '/subnets/', parameters('networkSettings').subnet.name)]" + "id": "[resourceId(parameters('networkSettings').resourceGroup, 'Microsoft.Network/virtualNetworks/subnets', parameters('networkSettings').name, parameters('networkSettings').subnet.name)]" }, "privateIPAddress": "[parameters('networkSettings').subnet.loadBalancerIp]", "privateIPAllocationMethod": "Static" @@ -59,10 +59,10 @@ "name": "es-http-internal", "properties": { "frontendIPConfiguration": { - "id": "[concat(resourceId('Microsoft.Network/loadBalancers',variables('internalLoadBalancerName')),'/frontendIPConfigurations/LBFE')]" + "id": "[resourceId('Microsoft.Network/loadBalancers/frontendIPConfigurations', variables('internalLoadBalancerName'), 'LBFE')]" }, "backendAddressPool": { - "id": "[concat(resourceId('Microsoft.Network/loadBalancers',variables('internalLoadBalancerName')),'/backendAddressPools/LBBE')]" + "id": "[resourceId('Microsoft.Network/loadBalancers/backendAddressPools', variables('internalLoadBalancerName'), 'LBBE')]" }, "protocol": "Tcp", "frontendPort": 9200, @@ -70,7 +70,7 @@ "enableFloatingIP": false, "idleTimeoutInMinutes": 5, "probe": { - "id": "[concat(resourceId('Microsoft.Network/loadBalancers',variables('internalLoadBalancerName')),'/probes/es-probe-internal-http')]" + "id": "[resourceId('Microsoft.Network/loadBalancers/probes', variables('internalLoadBalancerName'), 'es-probe-internal-http')]" } } }, @@ -78,10 +78,10 @@ "name": "es-transport-internal", "properties": { "frontendIPConfiguration": { - "id": "[concat(resourceId('Microsoft.Network/loadBalancers',variables('internalLoadBalancerName')),'/frontendIPConfigurations/LBFE')]" + "id": "[resourceId('Microsoft.Network/loadBalancers/frontendIPConfigurations', variables('internalLoadBalancerName'), 'LBFE')]" }, "backendAddressPool": { - "id": "[concat(resourceId('Microsoft.Network/loadBalancers',variables('internalLoadBalancerName')),'/backendAddressPools/LBBE')]" + "id": "[resourceId('Microsoft.Network/loadBalancers/backendAddressPools', variables('internalLoadBalancerName'), 'LBBE')]" }, "protocol": "Tcp", "frontendPort": 9300, diff --git a/src/loadbalancers/standard-application-gateway-resources.json b/src/loadbalancers/standard-application-gateway-resources.json index 114a7883..a56cc77d 100644 --- a/src/loadbalancers/standard-application-gateway-resources.json +++ b/src/loadbalancers/standard-application-gateway-resources.json @@ -28,7 +28,7 @@ "applicationGatewayName": "[concat(parameters('networkSettings').namespacePrefix, 'app-gateway')]", "applicationGatewayIp": "[concat(parameters('networkSettings').namespacePrefix, 'app-gateway-ip')]", "internalLoadBalancerName": "[concat(parameters('networkSettings').namespacePrefix, 'internal-lb')]", - "applicationGatewayId": "[resourceId('Microsoft.Network/applicationGateways',variables('applicationGatewayName'))]", + "applicationGatewayId": "[resourceId('Microsoft.Network/applicationGateways', variables('applicationGatewayName'))]", "authenticationCertsOpts": { "Yes": [ { @@ -66,7 +66,7 @@ "name": "LBFE", "properties": { "subnet": { - "id": "[concat(resourceId(parameters('networkSettings').resourceGroup, 'Microsoft.Network/virtualNetworks',parameters('networkSettings').name), '/subnets/', parameters('networkSettings').subnet.name)]" + "id": "[resourceId(parameters('networkSettings').resourceGroup, 'Microsoft.Network/virtualNetworks/subnets', parameters('networkSettings').name, parameters('networkSettings').subnet.name)]" }, "privateIPAddress": "[parameters('networkSettings').subnet.loadBalancerIp]", "privateIPAllocationMethod": "Static" @@ -83,10 +83,10 @@ "name": "es-http-internal", "properties": { "frontendIPConfiguration": { - "id": "[concat(resourceId('Microsoft.Network/loadBalancers',variables('internalLoadBalancerName')),'/frontendIPConfigurations/LBFE')]" + "id": "[resourceId('Microsoft.Network/loadBalancers/frontendIPConfigurations', variables('internalLoadBalancerName'), 'LBFE')]" }, "backendAddressPool": { - "id": "[concat(resourceId('Microsoft.Network/loadBalancers',variables('internalLoadBalancerName')),'/backendAddressPools/LBBE')]" + "id": "[resourceId('Microsoft.Network/loadBalancers/backendAddressPools', variables('internalLoadBalancerName'), 'LBBE')]" }, "protocol": "Tcp", "frontendPort": 9200, @@ -94,7 +94,7 @@ "enableFloatingIP": false, "idleTimeoutInMinutes": 5, "probe": { - "id": "[concat(resourceId('Microsoft.Network/loadBalancers',variables('internalLoadBalancerName')),'/probes/es-probe-internal-http')]" + "id": "[resourceId('Microsoft.Network/loadBalancers/probes', variables('internalLoadBalancerName'), 'es-probe-internal-http')]" } } }, @@ -102,10 +102,10 @@ "name": "es-transport-internal", "properties": { "frontendIPConfiguration": { - "id": "[concat(resourceId('Microsoft.Network/loadBalancers',variables('internalLoadBalancerName')),'/frontendIPConfigurations/LBFE')]" + "id": "[resourceId('Microsoft.Network/loadBalancers/frontendIPConfigurations', variables('internalLoadBalancerName'), 'LBFE')]" }, "backendAddressPool": { - "id": "[concat(resourceId('Microsoft.Network/loadBalancers',variables('internalLoadBalancerName')),'/backendAddressPools/LBBE')]" + "id": "[resourceId('Microsoft.Network/loadBalancers/backendAddressPools', variables('internalLoadBalancerName'), 'LBBE')]" }, "protocol": "Tcp", "frontendPort": 9300, @@ -172,7 +172,7 @@ "name": "es-app-gateway-ip", "properties": { "subnet": { - "id": "[concat(resourceId(parameters('networkSettings').resourceGroup, 'Microsoft.Network/virtualNetworks',parameters('networkSettings').name), '/subnets/', parameters('networkSettings').applicationGatewaySubnet.name)]" + "id": "[resourceId(parameters('networkSettings').resourceGroup, 'Microsoft.Network/virtualNetworks/subnets', parameters('networkSettings').name, parameters('networkSettings').applicationGatewaySubnet.name)]" } } } @@ -182,7 +182,7 @@ "name": "es-app-gateway-fip", "properties": { "publicIPAddress": { - "id": "[resourceId('Microsoft.Network/publicIPAddresses',variables('applicationGatewayIp'))]" + "id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('applicationGatewayIp'))]" } } } diff --git a/src/loadbalancers/waf-application-gateway-resources.json b/src/loadbalancers/waf-application-gateway-resources.json index 40e06a5c..14a1b67c 100644 --- a/src/loadbalancers/waf-application-gateway-resources.json +++ b/src/loadbalancers/waf-application-gateway-resources.json @@ -71,7 +71,7 @@ "name": "LBFE", "properties": { "subnet": { - "id": "[concat(resourceId(parameters('networkSettings').resourceGroup, 'Microsoft.Network/virtualNetworks',parameters('networkSettings').name), '/subnets/', parameters('networkSettings').subnet.name)]" + "id": "[resourceId(parameters('networkSettings').resourceGroup, 'Microsoft.Network/virtualNetworks/subnets', parameters('networkSettings').name, parameters('networkSettings').subnet.name)]" }, "privateIPAddress": "[parameters('networkSettings').subnet.loadBalancerIp]", "privateIPAllocationMethod": "Static" @@ -88,10 +88,10 @@ "name": "es-http-internal", "properties": { "frontendIPConfiguration": { - "id": "[concat(resourceId('Microsoft.Network/loadBalancers',variables('internalLoadBalancerName')),'/frontendIPConfigurations/LBFE')]" + "id": "[resourceId('Microsoft.Network/loadBalancers/frontendIPConfigurations', variables('internalLoadBalancerName'), 'LBFE')]" }, "backendAddressPool": { - "id": "[concat(resourceId('Microsoft.Network/loadBalancers',variables('internalLoadBalancerName')),'/backendAddressPools/LBBE')]" + "id": "[resourceId('Microsoft.Network/loadBalancers/backendAddressPools', variables('internalLoadBalancerName'), 'LBBE')]" }, "protocol": "Tcp", "frontendPort": 9200, @@ -99,7 +99,7 @@ "enableFloatingIP": false, "idleTimeoutInMinutes": 5, "probe": { - "id": "[concat(resourceId('Microsoft.Network/loadBalancers',variables('internalLoadBalancerName')),'/probes/es-probe-internal-http')]" + "id": "[resourceId('Microsoft.Network/loadBalancers/probes', variables('internalLoadBalancerName'), 'es-probe-internal-http')]" } } }, @@ -107,10 +107,10 @@ "name": "es-transport-internal", "properties": { "frontendIPConfiguration": { - "id": "[concat(resourceId('Microsoft.Network/loadBalancers',variables('internalLoadBalancerName')),'/frontendIPConfigurations/LBFE')]" + "id": "[resourceId('Microsoft.Network/loadBalancers/frontendIPConfigurations', variables('internalLoadBalancerName'), 'LBFE')]" }, "backendAddressPool": { - "id": "[concat(resourceId('Microsoft.Network/loadBalancers',variables('internalLoadBalancerName')),'/backendAddressPools/LBBE')]" + "id": "[resourceId('Microsoft.Network/loadBalancers/backendAddressPools', variables('internalLoadBalancerName'), 'LBBE')]" }, "protocol": "Tcp", "frontendPort": 9300, @@ -177,7 +177,7 @@ "name": "es-app-gateway-ip", "properties": { "subnet": { - "id": "[concat(resourceId(parameters('networkSettings').resourceGroup, 'Microsoft.Network/virtualNetworks',parameters('networkSettings').name), '/subnets/', parameters('networkSettings').applicationGatewaySubnet.name)]" + "id": "[resourceId(parameters('networkSettings').resourceGroup, 'Microsoft.Network/virtualNetworks/subnets', parameters('networkSettings').name, parameters('networkSettings').applicationGatewaySubnet.name)]" } } } @@ -187,7 +187,7 @@ "name": "es-app-gateway-fip", "properties": { "publicIPAddress": { - "id": "[resourceId('Microsoft.Network/publicIPAddresses',variables('applicationGatewayIp'))]" + "id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('applicationGatewayIp'))]" } } } diff --git a/src/machines/jumpbox-resources.json b/src/machines/jumpbox-resources.json index 6c276020..062b562c 100644 --- a/src/machines/jumpbox-resources.json +++ b/src/machines/jumpbox-resources.json @@ -51,7 +51,7 @@ "variables": { "namespace": "[parameters('namespace')]", "vmSize": "Standard_A0", - "subnetRef": "[concat(resourceId(parameters('networkSettings').resourceGroup, 'Microsoft.Network/virtualNetworks', parameters('networkSettings').name), '/subnets/', parameters('networkSettings').subnet.name)]", + "subnetId": "[resourceId(parameters('networkSettings').resourceGroup, 'Microsoft.Network/virtualNetworks/subnets', parameters('networkSettings').name, parameters('networkSettings').subnet.name)]", "publicIpName": "[concat(variables('namespace'), '-ip')]", "securityGroupName": "[concat(variables('namespace'), '-nsg')]", "nicName": "[concat(variables('namespace'), '-nic')]", @@ -137,10 +137,10 @@ "properties": { "privateIPAllocationMethod": "Dynamic", "publicIPAddress": { - "id": "[resourceId('Microsoft.Network/publicIPAddresses',variables('publicIpName'))]" + "id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('publicIpName'))]" }, "subnet": { - "id": "[variables('subnetRef')]" + "id": "[variables('subnetId')]" } } } diff --git a/src/machines/kibana-resources.json b/src/machines/kibana-resources.json index 8de698e5..5bbccb97 100644 --- a/src/machines/kibana-resources.json +++ b/src/machines/kibana-resources.json @@ -68,7 +68,7 @@ }, "variables": { "namespace": "[parameters('namespace')]", - "subnetId": "[concat(resourceId(parameters('networkSettings').resourceGroup, 'Microsoft.Network/virtualNetworks', parameters('networkSettings').name), '/subnets/', parameters('networkSettings').subnet.name)]", + "subnetId": "[resourceId(parameters('networkSettings').resourceGroup, 'Microsoft.Network/virtualNetworks/subnets', parameters('networkSettings').name, parameters('networkSettings').subnet.name)]", "publicIpName": "[concat(variables('namespace'), '-ip')]", "securityGroupName": "[concat(variables('namespace'), '-nsg')]", "nicName": "[concat(variables('namespace'), '-nic')]", diff --git a/src/machines/logstash-resources.json b/src/machines/logstash-resources.json index 0e78499e..ac78c9c2 100644 --- a/src/machines/logstash-resources.json +++ b/src/machines/logstash-resources.json @@ -68,7 +68,7 @@ }, "variables": { "namespace": "[parameters('namespace')]", - "subnetId": "[concat(resourceId(parameters('networkSettings').resourceGroup, 'Microsoft.Network/virtualNetworks', parameters('networkSettings').name), '/subnets/', parameters('networkSettings').subnet.name)]", + "subnetId": "[resourceId(parameters('networkSettings').resourceGroup, 'Microsoft.Network/virtualNetworks/subnets', parameters('networkSettings').name, parameters('networkSettings').subnet.name)]", "nicName": "[concat(variables('namespace'), '-nic')]", "password_osProfile": { "computername": "[parameters('namespace')]", diff --git a/src/mainTemplate.json b/src/mainTemplate.json index 7e020d7a..18d8c2c9 100644 --- a/src/mainTemplate.json +++ b/src/mainTemplate.json @@ -1856,20 +1856,20 @@ "backendPoolConfigurations": { "internal": [ { - "id": "[concat(resourceId('Microsoft.Network/loadBalancers',concat(parameters('vmHostNamePrefix'), 'internal-lb')),'/backendAddressPools/LBBE')]" + "id": "[resourceId('Microsoft.Network/loadBalancers/backendAddressPools', concat(parameters('vmHostNamePrefix'), 'internal-lb'), 'LBBE')]" } ], "external": [ { - "id": "[concat(resourceId('Microsoft.Network/loadBalancers',concat(parameters('vmHostNamePrefix'), 'internal-lb')),'/backendAddressPools/LBBE')]" + "id": "[resourceId('Microsoft.Network/loadBalancers/backendAddressPools', concat(parameters('vmHostNamePrefix'), 'internal-lb'), 'LBBE')]" }, { - "id": "[concat(resourceId('Microsoft.Network/loadBalancers',concat(parameters('vmHostNamePrefix'), 'external-lb')),'/backendAddressPools/LBBE')]" + "id": "[resourceId('Microsoft.Network/loadBalancers/backendAddressPools', concat(parameters('vmHostNamePrefix'), 'external-lb'), 'LBBE')]" } ], "gateway": [ { - "id": "[concat(resourceId('Microsoft.Network/loadBalancers',concat(parameters('vmHostNamePrefix'), 'internal-lb')),'/backendAddressPools/LBBE')]" + "id": "[resourceId('Microsoft.Network/loadBalancers/backendAddressPools', concat(parameters('vmHostNamePrefix'), 'internal-lb'), 'LBBE')]" } ] }, @@ -1956,7 +1956,7 @@ "storageAccountName": "[concat('elastic', uniqueString(resourceGroup().id, deployment().name))]", "location": "[variables('location')]", "subnet": "[variables('networkSettings').subnet]", - "subnetId": "[concat(resourceId(variables('networkSettings').resourceGroup, 'Microsoft.Network/virtualNetworks', variables('networkSettings').name), '/subnets/', variables('networkSettings').subnet.name)]", + "subnetId": "[resourceId(variables('networkSettings').resourceGroup, 'Microsoft.Network/virtualNetworks/subnets', variables('networkSettings').name, variables('networkSettings').subnet.name)]", "credentials": { "adminUsername": "[parameters('adminUsername')]", "password": "[parameters('adminPassword')]",