Bastion Host


The Bastion Host builder creates a bastion host to access resources inside a virtual network. It also creates a static public IP for the bastion host.

  • BastionHosts (Microsoft.Network/bastionHosts)

Builder Keywords

Applies ToKeywordPurpose
bastionvnetName of the virtual network the bastion host can access.
bastionlink_to_vnetLink to an existing virtual network (no dependsOn emitted.
bastionscale_unitsNumber of scale units when more connections are needed. Default is 2 and more scale units will use the Standard SKU.
bastiondisable_copy_pasteDisables copy and paste to and from the bastion - enabling this upgrades to the Standard SKU.
bastiondns_nameSet the DNS name for accessing the bastion host.
bastionenable_file_copyUpload and download files to the target VM.
bastionenable_ip_connectConnect to virtual machines by IP address instead of using their target resource Id.
bastionenable_kerberosEnable kerberos authentication support for supporting scenarios such as Windows Single Sign On.
bastionenable_shareable_linklets users connect to a target resource using Azure Bastion without accessing the Azure portal.
bastionenable_tunnelingSet up tunnels through the bastion host so native client tools can be used.


#r "nuget:Farmer"

open Farmer
open Farmer.Builders

arm {
    location Location.EastUS
    add_resources [
        vnet {
            name "private-network"
            add_address_spaces [
            add_subnets [
                subnet {
                    name "default"
                    prefix ""
                subnet {
                    name "AzureBastionSubnet"
                    prefix ""
        bastion {
            name "my-bastion-host"
            vnet "private-network"
            enable_shareable_link true
            enable_tunneling true
            scale_units 2