Virtual Network Gateway

Overview

The Virtual Network Gateway builder creates virtual network gateways for ExpressRoute or VPN connections to a virtual network.

  • Virtual Network Gateways (Microsoft.Network/virtualNetworkGatways)
  • Connections (Microsoft.Network/connections)

Builder Keywords

Applies ToKeywordPurpose
GatewaynameSpecifies the name of the virtual network gateway
GatewayvnetThe name of the virtual network to which the gateway connects
Gatewayer_gateway_skuSKU for an ExpressRoute gateway
Gatewayvpn_gateway_skuSKU for a VPN gateway
Gatewayvpn_typeSets the VPN type to route-based (default) or policy-based.
Gatewaygateway_ip_configSpecifies the gateway public and private IP addresses
Gatewayactive_active_ip_configSpecifies the second public and private IP configuration for a redundant gateway
Gatewaydisable_bgpBGP is enabled by default, but this can disable it
Gatewayvpn_clientSpecifies the VPN client configuration using the vpnclient builder (optional)
VPNClientadd_address_poolThe reference of the address space resource which represents Address space for P2S VpnClient
VPNClientadd_root_certificateAdds the name and the public data of a root certificate to validate client certificates used for VPN Client connection. This can be either just the data of the base64 content of the certificate or a multiline string starting with —–BEGIN CERTIFICATE—– and ending with —–END CERTIFICATE—–
VPNClientadd_revoked_certificateAdds the name and the thumbprint of a revoked client certificate
VPNClientprotocolsSets the protocols for the VPN client. SSTP (default), IkeV2 or OpenVPN
ConnectionnameSpecifies the name of the connection
Connectionvnet_gateway1Name of the first vnet gateway this is connecting
Connectionvnet_gateway2Name of the second vnet gateway this is connecting, for use when connecting two vnets
Connectionlocal_gatewayName of the local gateway connection for a VPN
Connectionpeer_idId of the peer, typically an ExpressRoute circuit Id
Connectionauth_keyAuthorization key used when peering across subscriptions

Example

open Farmer
open Farmer.Builders
open Farmer.VirtualNetworkGateway

let gw = gateway {
    name "er-gateway"
    vnet "my-vnet" // Must contain a subnet named 'GatewaySubnet'
    er_gateway_sku ErGatewaySku.Standard

    vpn_client
        (vpnclient {
           add_address_pool "10.31.0.0/16"
           add_root_certificate "rootcert" "" })
}


let privateNet = vnet {
    name "my-vnet"
    add_address_spaces [
        "10.30.0.0/16"
    ]
    add_subnets [
        subnet {
            name "GatewaySubnet"
            prefix "10.30.254.0/28"
        }
    ]
}