VNet Connection "propagate to none" with Bicep

Eric Hodges 46 Reputation points
2022-04-25T14:10:00.463+00:00

I am attempting to peer vnets together in my virtual hub with a Bicep template. This is what I want to produce, from the point of view of the GUI:

196204-image.png

In particular, I cannot see how to set "propagate to none" = Yes with Bicep (or ARM) using the Microsoft.Network/virtualHubs/hubVirtualNetworkConnections resource.

Thanks,
Eric

Azure Virtual Network
Azure Virtual Network
An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
2,139 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Eric Hodges 46 Reputation points
    2022-04-25T16:34:55.45+00:00

    I was able to figure this out. Essentially, you reference the "noneRouteTable" which is part of the virtual hub. Here is an example "Microsoft.Network/virtualNetworks" resource. (Earlier in the file I defined the vHub, which I called 'vHub' and is named "TestVHub".)

    resource vHub_spoke1 'Microsoft.Network/virtualHubs/hubVirtualNetworkConnections@2021-05-01' = {
      name: 'TestVHub-net1'
      parent: vHub
      properties: {
        remoteVirtualNetwork: {
          id: spoke1.id
        }
        allowHubToRemoteVnetTransit: true
        allowRemoteVnetToUseHubVnetGateways: true
        enableInternetSecurity: true
        routingConfiguration: {
          associatedRouteTable: {
            id:  resourceId('Microsoft.Network/virtualHubs/hubRouteTables', 'TestVHub', 'defaultRouteTable')
          }
          propagatedRouteTables: {
            ids: [
              {
                id: resourceId('Microsoft.Network/virtualHubs/hubRouteTables', 'TestVHub', 'noneRouteTable')
              }
            ]
            labels: [
              'none'
            ]
          }
        }
      }
    }