ARM template for existing Vnet Peering

Copper Contributor

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.

1 Reply
best response confirmed by nirmalmcse02 (Copper Contributor)

@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'))]"