Skip to content
This repository has been archived by the owner on Mar 30, 2023. It is now read-only.

Commit

Permalink
Update usage pattern of resourceId()
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
russcam committed Jun 17, 2019
1 parent e77178a commit 8d9f667
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 42 deletions.
18 changes: 9 additions & 9 deletions src/loadbalancers/external-lb-resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -66,29 +66,29 @@
"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,
"backendPort": 9200,
"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')]"
}
}
},
{
"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,
Expand Down Expand Up @@ -158,18 +158,18 @@
"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,
"backendPort": 9201,
"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')]"
}
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/loadbalancers/internal-lb-resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -59,29 +59,29 @@
"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,
"backendPort": 9200,
"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')]"
}
}
},
{
"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,
Expand Down
18 changes: 9 additions & 9 deletions src/loadbalancers/standard-application-gateway-resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
{
Expand Down Expand Up @@ -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"
Expand All @@ -83,29 +83,29 @@
"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,
"backendPort": 9200,
"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')]"
}
}
},
{
"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,
Expand Down Expand Up @@ -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)]"
}
}
}
Expand All @@ -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'))]"
}
}
}
Expand Down
16 changes: 8 additions & 8 deletions src/loadbalancers/waf-application-gateway-resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -88,29 +88,29 @@
"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,
"backendPort": 9200,
"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')]"
}
}
},
{
"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,
Expand Down Expand Up @@ -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)]"
}
}
}
Expand All @@ -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'))]"
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/machines/jumpbox-resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -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')]",
Expand Down Expand Up @@ -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')]"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/machines/kibana-resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -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')]",
Expand Down
2 changes: 1 addition & 1 deletion src/machines/logstash-resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -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')]",
Expand Down
Loading

0 comments on commit 8d9f667

Please sign in to comment.