Seems as if remote vnet peering for virtual networks does not support the remote vnet being in a different resource group
thinkdavid opened this issue · 1 comments
thinkdavid commented
Creating a virtual network peering requires two resources to be deployed.
A peering resource on the remote must be created as well as the initial network.
for example:
{
"apiVersion": "2020-05-01",
"dependsOn": [
"[resourceId('Microsoft.Network/virtualNetworks', 'tnt45-svcs-p30-westcentralus-fleet-vnet')]"
],
"location": "westeurope",
"name": "tnt45-svcs-p30-westcentralus-fleet-vnet/peering-tnt45-mgmt-p30-westcentralus-vnet",
"properties": {
"allowForwardedTraffic": true,
"allowGatewayTransit": false,
"allowVirtualNetworkAccess": true,
"remoteVirtualNetwork": {
"id": "[resourceId('d6d55a90-6c37-42aa-a68b-00a3658d0a2f', 'tnt45-mgmt-p30-westcentralus', 'Microsoft.Network/virtualNetworks', 'tnt45-mgmt-p30-westcentralus-vnet')]"
},
"useRemoteGateways": false
},
"type": "Microsoft.Network/virtualNetworks/virtualNetworkPeerings"
},
{
"apiVersion": "2020-05-01",
"dependsOn": [
"[resourceId('Microsoft.Network/virtualNetworks', 'tnt45-svcs-p30-westcentralus-fleet-vnet')]"
],
"location": "westeurope",
"name": "tnt45-mgmt-p30-westcentralus-vnet/peering-tnt45-svcs-p30-westcentralus-fleet-vnet",
"properties": {
"allowForwardedTraffic": true,
"allowGatewayTransit": false,
"allowVirtualNetworkAccess": true,
"remoteVirtualNetwork": {
"id": "[resourceId('Microsoft.Network/virtualNetworks', 'tnt45-svcs-p30-westcentralus-fleet-vnet')]"
},
"useRemoteGateways": false
},
"type": "Microsoft.Network/virtualNetworks/virtualNetworkPeerings"
}
The first resource in the example deploys successfully, but the second doesn't with an ARM resource not found exception.
I believe this is due to it being in a different resource group, and so I think it cannot be part of the same template.
isaacabraham commented
One for @ninjarobot I think!