Oct 12 2020 04:13 AM
Hi All,
Is there any ARM template available for establishing VNET Peering for two existing Virtual Network.
I am referring below GitHub template. However it is creating one side peering only not vise versa.
https://github.com/Azure/azure-quickstart-templates/tree/master/201-existing-vnet-to-vnet-peering
Nov 03 2020 07:36 AM
Solution@nirmalmcse02 Hi, if you copy this resource change relevant parameters to the peer that is missing.
These changes will allow you to create the missing peer. (Remember to change resource name below to something different than what it is currently or naming conflict will appear)
{
"apiVersion": "2019-11-01",
"type": "Microsoft.Network/virtualNetworks/virtualNetworkPeerings",
"name": "[concat(parameters('existingLocalVirtualNetworkName'), '/peering-to-remote-vnet')]",
"location": "[parameters('location')]",
"properties": {
"allowVirtualNetworkAccess": true,
"allowForwardedTraffic": false,
"allowGatewayTransit": false,
"useRemoteGateways": false,
"remoteVirtualNetwork": {
"id": "[resourceId(parameters('existingRemoteVirtualNetworkResourceGroupName'), 'Microsoft.Network/virtualNetworks', parameters('existingRemoteVirtualNetworkName'))]"
}
}
}