Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seems as if remote vnet peering for virtual networks does not support the remote vnet being in a different resource group #1089

Open
thinkdavid opened this issue Dec 23, 2023 · 1 comment

Comments

@thinkdavid
Copy link
Contributor

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
Copy link
Member

One for @ninjarobot I think!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants