Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
- Latest
- 2025-01-01
- 2024-10-01
- 2024-07-01
- 2024-05-01
- 2024-03-01
- 2024-01-01
- 2023-11-01
- 2023-09-01
- 2023-06-01
- 2023-05-01
- 2023-04-01
- 2023-02-01
- 2022-11-01
- 2022-09-01
- 2022-07-01
- 2022-05-01
- 2022-01-01
- 2021-08-01
- 2021-05-01
- 2021-03-01
- 2021-02-01
- 2020-11-01
- 2020-08-01
- 2020-07-01
- 2020-06-01
- 2020-05-01
- 2020-04-01
- 2020-03-01
- 2019-12-01
- 2019-11-01
- 2019-09-01
- 2019-08-01
- 2019-07-01
- 2019-06-01
- 2019-04-01
- 2019-02-01
- 2018-12-01
- 2018-11-01
- 2018-10-01
- 2018-08-01
- 2018-07-01
- 2018-06-01
- 2018-04-01
Bicep resource definition
The vpnGateways/vpnConnections resource type can be deployed with operations that target:
For a list of changed properties in each API version, see change log.
Resource format
To create a Microsoft.Network/vpnGateways/vpnConnections resource, add the following Bicep to your template.
resource symbolicname 'Microsoft.Network/vpnGateways/vpnConnections@2019-04-01' = {
parent: resourceSymbolicName
name: 'string'
properties: {
connectionBandwidth: int
enableBgp: bool
enableInternetSecurity: bool
enableRateLimiting: bool
ipsecPolicies: [
{
dhGroup: 'string'
ikeEncryption: 'string'
ikeIntegrity: 'string'
ipsecEncryption: 'string'
ipsecIntegrity: 'string'
pfsGroup: 'string'
saDataSizeKilobytes: int
saLifeTimeSeconds: int
}
]
remoteVpnSite: {
id: 'string'
}
routingWeight: int
sharedKey: 'string'
useLocalAzureIpAddress: bool
usePolicyBasedTrafficSelectors: bool
vpnConnectionProtocolType: 'string'
}
}
Property Values
Microsoft.Network/vpnGateways/vpnConnections
| Name | Description | Value |
|---|---|---|
| name | The resource name | string (required) |
| parent | In Bicep, you can specify the parent resource for a child resource. You only need to add this property when the child resource is declared outside of the parent resource. For more information, see Child resource outside parent resource. |
Symbolic name for resource of type: vpnGateways |
| properties | Properties of the VPN connection. | VpnConnectionProperties |
IpsecPolicy
| Name | Description | Value |
|---|---|---|
| dhGroup | The DH Group used in IKE Phase 1 for initial SA. | 'DHGroup1' 'DHGroup14' 'DHGroup2' 'DHGroup2048' 'DHGroup24' 'ECP256' 'ECP384' 'None' (required) |
| ikeEncryption | The IKE encryption algorithm (IKE phase 2). | 'AES128' 'AES192' 'AES256' 'DES' 'DES3' 'GCMAES128' 'GCMAES256' (required) |
| ikeIntegrity | The IKE integrity algorithm (IKE phase 2). | 'GCMAES128' 'GCMAES256' 'MD5' 'SHA1' 'SHA256' 'SHA384' (required) |
| ipsecEncryption | The IPSec encryption algorithm (IKE phase 1). | 'AES128' 'AES192' 'AES256' 'DES' 'DES3' 'GCMAES128' 'GCMAES192' 'GCMAES256' 'None' (required) |
| ipsecIntegrity | The IPSec integrity algorithm (IKE phase 1). | 'GCMAES128' 'GCMAES192' 'GCMAES256' 'MD5' 'SHA1' 'SHA256' (required) |
| pfsGroup | The Pfs Group used in IKE Phase 2 for new child SA. | 'ECP256' 'ECP384' 'None' 'PFS1' 'PFS14' 'PFS2' 'PFS2048' 'PFS24' 'PFSMM' (required) |
| saDataSizeKilobytes | The IPSec Security Association (also called Quick Mode or Phase 2 SA) payload size in KB for a site to site VPN tunnel. | int (required) |
| saLifeTimeSeconds | The IPSec Security Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for a site to site VPN tunnel. | int (required) |
SubResource
| Name | Description | Value |
|---|---|---|
| id | Resource ID. | string |
VpnConnectionProperties
| Name | Description | Value |
|---|---|---|
| connectionBandwidth | Expected bandwidth in MBPS. | int |
| enableBgp | EnableBgp flag. | bool |
| enableInternetSecurity | Enable internet security. | bool |
| enableRateLimiting | EnableBgp flag. | bool |
| ipsecPolicies | The IPSec Policies to be considered by this connection. | IpsecPolicy[] |
| remoteVpnSite | Id of the connected vpn site. | SubResource |
| routingWeight | Routing weight for vpn connection. | int |
| sharedKey | SharedKey for the vpn connection. | string |
| useLocalAzureIpAddress | Use local azure ip to initiate connection. | bool |
| usePolicyBasedTrafficSelectors | Enable policy-based traffic selectors. | bool |
| vpnConnectionProtocolType | Connection protocol used for this connection. | 'IKEv1' 'IKEv2' |
ARM template resource definition
The vpnGateways/vpnConnections resource type can be deployed with operations that target:
For a list of changed properties in each API version, see change log.
Resource format
To create a Microsoft.Network/vpnGateways/vpnConnections resource, add the following JSON to your template.
{
"type": "Microsoft.Network/vpnGateways/vpnConnections",
"apiVersion": "2019-04-01",
"name": "string",
"properties": {
"connectionBandwidth": "int",
"enableBgp": "bool",
"enableInternetSecurity": "bool",
"enableRateLimiting": "bool",
"ipsecPolicies": [
{
"dhGroup": "string",
"ikeEncryption": "string",
"ikeIntegrity": "string",
"ipsecEncryption": "string",
"ipsecIntegrity": "string",
"pfsGroup": "string",
"saDataSizeKilobytes": "int",
"saLifeTimeSeconds": "int"
}
],
"remoteVpnSite": {
"id": "string"
},
"routingWeight": "int",
"sharedKey": "string",
"useLocalAzureIpAddress": "bool",
"usePolicyBasedTrafficSelectors": "bool",
"vpnConnectionProtocolType": "string"
}
}
Property Values
Microsoft.Network/vpnGateways/vpnConnections
| Name | Description | Value |
|---|---|---|
| apiVersion | The api version | '2019-04-01' |
| name | The resource name | string (required) |
| properties | Properties of the VPN connection. | VpnConnectionProperties |
| type | The resource type | 'Microsoft.Network/vpnGateways/vpnConnections' |
IpsecPolicy
| Name | Description | Value |
|---|---|---|
| dhGroup | The DH Group used in IKE Phase 1 for initial SA. | 'DHGroup1' 'DHGroup14' 'DHGroup2' 'DHGroup2048' 'DHGroup24' 'ECP256' 'ECP384' 'None' (required) |
| ikeEncryption | The IKE encryption algorithm (IKE phase 2). | 'AES128' 'AES192' 'AES256' 'DES' 'DES3' 'GCMAES128' 'GCMAES256' (required) |
| ikeIntegrity | The IKE integrity algorithm (IKE phase 2). | 'GCMAES128' 'GCMAES256' 'MD5' 'SHA1' 'SHA256' 'SHA384' (required) |
| ipsecEncryption | The IPSec encryption algorithm (IKE phase 1). | 'AES128' 'AES192' 'AES256' 'DES' 'DES3' 'GCMAES128' 'GCMAES192' 'GCMAES256' 'None' (required) |
| ipsecIntegrity | The IPSec integrity algorithm (IKE phase 1). | 'GCMAES128' 'GCMAES192' 'GCMAES256' 'MD5' 'SHA1' 'SHA256' (required) |
| pfsGroup | The Pfs Group used in IKE Phase 2 for new child SA. | 'ECP256' 'ECP384' 'None' 'PFS1' 'PFS14' 'PFS2' 'PFS2048' 'PFS24' 'PFSMM' (required) |
| saDataSizeKilobytes | The IPSec Security Association (also called Quick Mode or Phase 2 SA) payload size in KB for a site to site VPN tunnel. | int (required) |
| saLifeTimeSeconds | The IPSec Security Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for a site to site VPN tunnel. | int (required) |
SubResource
| Name | Description | Value |
|---|---|---|
| id | Resource ID. | string |
VpnConnectionProperties
| Name | Description | Value |
|---|---|---|
| connectionBandwidth | Expected bandwidth in MBPS. | int |
| enableBgp | EnableBgp flag. | bool |
| enableInternetSecurity | Enable internet security. | bool |
| enableRateLimiting | EnableBgp flag. | bool |
| ipsecPolicies | The IPSec Policies to be considered by this connection. | IpsecPolicy[] |
| remoteVpnSite | Id of the connected vpn site. | SubResource |
| routingWeight | Routing weight for vpn connection. | int |
| sharedKey | SharedKey for the vpn connection. | string |
| useLocalAzureIpAddress | Use local azure ip to initiate connection. | bool |
| usePolicyBasedTrafficSelectors | Enable policy-based traffic selectors. | bool |
| vpnConnectionProtocolType | Connection protocol used for this connection. | 'IKEv1' 'IKEv2' |
Usage Examples
Terraform (AzAPI provider) resource definition
The vpnGateways/vpnConnections resource type can be deployed with operations that target:
For a list of changed properties in each API version, see change log.
Resource format
To create a Microsoft.Network/vpnGateways/vpnConnections resource, add the following Terraform to your template.
resource "azapi_resource" "symbolicname" {
type = "Microsoft.Network/vpnGateways/vpnConnections@2019-04-01"
name = "string"
parent_id = "string"
body = {
properties = {
connectionBandwidth = int
enableBgp = bool
enableInternetSecurity = bool
enableRateLimiting = bool
ipsecPolicies = [
{
dhGroup = "string"
ikeEncryption = "string"
ikeIntegrity = "string"
ipsecEncryption = "string"
ipsecIntegrity = "string"
pfsGroup = "string"
saDataSizeKilobytes = int
saLifeTimeSeconds = int
}
]
remoteVpnSite = {
id = "string"
}
routingWeight = int
sharedKey = "string"
useLocalAzureIpAddress = bool
usePolicyBasedTrafficSelectors = bool
vpnConnectionProtocolType = "string"
}
}
}
Property Values
Microsoft.Network/vpnGateways/vpnConnections
| Name | Description | Value |
|---|---|---|
| name | The resource name | string (required) |
| parent_id | The ID of the resource that is the parent for this resource. | ID for resource of type: vpnGateways |
| properties | Properties of the VPN connection. | VpnConnectionProperties |
| type | The resource type | "Microsoft.Network/vpnGateways/vpnConnections@2019-04-01" |
IpsecPolicy
| Name | Description | Value |
|---|---|---|
| dhGroup | The DH Group used in IKE Phase 1 for initial SA. | 'DHGroup1' 'DHGroup14' 'DHGroup2' 'DHGroup2048' 'DHGroup24' 'ECP256' 'ECP384' 'None' (required) |
| ikeEncryption | The IKE encryption algorithm (IKE phase 2). | 'AES128' 'AES192' 'AES256' 'DES' 'DES3' 'GCMAES128' 'GCMAES256' (required) |
| ikeIntegrity | The IKE integrity algorithm (IKE phase 2). | 'GCMAES128' 'GCMAES256' 'MD5' 'SHA1' 'SHA256' 'SHA384' (required) |
| ipsecEncryption | The IPSec encryption algorithm (IKE phase 1). | 'AES128' 'AES192' 'AES256' 'DES' 'DES3' 'GCMAES128' 'GCMAES192' 'GCMAES256' 'None' (required) |
| ipsecIntegrity | The IPSec integrity algorithm (IKE phase 1). | 'GCMAES128' 'GCMAES192' 'GCMAES256' 'MD5' 'SHA1' 'SHA256' (required) |
| pfsGroup | The Pfs Group used in IKE Phase 2 for new child SA. | 'ECP256' 'ECP384' 'None' 'PFS1' 'PFS14' 'PFS2' 'PFS2048' 'PFS24' 'PFSMM' (required) |
| saDataSizeKilobytes | The IPSec Security Association (also called Quick Mode or Phase 2 SA) payload size in KB for a site to site VPN tunnel. | int (required) |
| saLifeTimeSeconds | The IPSec Security Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for a site to site VPN tunnel. | int (required) |
SubResource
| Name | Description | Value |
|---|---|---|
| id | Resource ID. | string |
VpnConnectionProperties
| Name | Description | Value |
|---|---|---|
| connectionBandwidth | Expected bandwidth in MBPS. | int |
| enableBgp | EnableBgp flag. | bool |
| enableInternetSecurity | Enable internet security. | bool |
| enableRateLimiting | EnableBgp flag. | bool |
| ipsecPolicies | The IPSec Policies to be considered by this connection. | IpsecPolicy[] |
| remoteVpnSite | Id of the connected vpn site. | SubResource |
| routingWeight | Routing weight for vpn connection. | int |
| sharedKey | SharedKey for the vpn connection. | string |
| useLocalAzureIpAddress | Use local azure ip to initiate connection. | bool |
| usePolicyBasedTrafficSelectors | Enable policy-based traffic selectors. | bool |
| vpnConnectionProtocolType | Connection protocol used for this connection. | 'IKEv1' 'IKEv2' |
Usage Examples
Terraform Samples
A basic example of deploying VPN Gateway Connection.
terraform {
required_providers {
azapi = {
source = "Azure/azapi"
}
}
}
provider "azapi" {
skip_provider_registration = false
}
variable "resource_name" {
type = string
default = "acctest0001"
}
variable "___location" {
type = string
default = "westeurope"
}
resource "azapi_resource" "resourceGroup" {
type = "Microsoft.Resources/resourceGroups@2020-06-01"
name = var.resource_name
___location = var.___location
}
resource "azapi_resource" "virtualWan" {
type = "Microsoft.Network/virtualWans@2022-07-01"
parent_id = azapi_resource.resourceGroup.id
name = var.resource_name
___location = var.___location
body = {
properties = {
allowBranchToBranchTraffic = true
disableVpnEncryption = false
office365LocalBreakoutCategory = "None"
type = "Standard"
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}
resource "azapi_resource" "virtualHub" {
type = "Microsoft.Network/virtualHubs@2022-07-01"
parent_id = azapi_resource.resourceGroup.id
name = var.resource_name
___location = var.___location
body = {
properties = {
addressPrefix = "10.0.0.0/24"
hubRoutingPreference = "ExpressRoute"
virtualRouterAutoScaleConfiguration = {
minCapacity = 2
}
virtualWan = {
id = azapi_resource.virtualWan.id
}
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}
resource "azapi_resource" "vpnSite" {
type = "Microsoft.Network/vpnSites@2022-07-01"
parent_id = azapi_resource.resourceGroup.id
name = var.resource_name
___location = var.___location
body = {
properties = {
addressSpace = {
addressPrefixes = [
"10.0.1.0/24",
]
}
virtualWan = {
id = azapi_resource.virtualWan.id
}
vpnSiteLinks = [
{
name = "link1"
properties = {
fqdn = ""
ipAddress = "10.0.1.1"
linkProperties = {
linkProviderName = ""
linkSpeedInMbps = 0
}
}
},
{
name = "link2"
properties = {
fqdn = ""
ipAddress = "10.0.1.2"
linkProperties = {
linkProviderName = ""
linkSpeedInMbps = 0
}
}
},
]
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}
data "azapi_resource_id" "link1" {
type = "Microsoft.Network/vpnSites/vpnSiteLinks@2022-07-01"
parent_id = azapi_resource.vpnSite.id
name = "link1"
}
data "azapi_resource_id" "link2" {
type = "Microsoft.Network/vpnSites/vpnSiteLinks@2022-07-01"
parent_id = azapi_resource.vpnSite.id
name = "link2"
}
resource "azapi_resource" "vpnGateway" {
type = "Microsoft.Network/vpnGateways@2022-07-01"
parent_id = azapi_resource.resourceGroup.id
name = var.resource_name
___location = var.___location
body = {
properties = {
enableBgpRouteTranslationForNat = false
isRoutingPreferenceInternet = false
virtualHub = {
id = azapi_resource.virtualHub.id
}
vpnGatewayScaleUnit = 1
}
}
schema_validation_enabled = false
response_export_values = ["*"]
timeouts {
create = "180m"
update = "180m"
delete = "60m"
}
}
resource "azapi_resource" "vpnConnection" {
type = "Microsoft.Network/vpnGateways/vpnConnections@2022-07-01"
parent_id = azapi_resource.vpnGateway.id
name = var.resource_name
body = {
properties = {
enableInternetSecurity = false
remoteVpnSite = {
id = azapi_resource.vpnSite.id
}
vpnLinkConnections = [
{
name = "link1"
properties = {
connectionBandwidth = 10
enableBgp = false
enableRateLimiting = false
routingWeight = 0
useLocalAzureIpAddress = false
usePolicyBasedTrafficSelectors = false
vpnConnectionProtocolType = "IKEv2"
vpnGatewayCustomBgpAddresses = [
]
vpnLinkConnectionMode = "Default"
vpnSiteLink = {
id = data.azapi_resource_id.link1.id
}
}
},
{
name = "link2"
properties = {
connectionBandwidth = 10
enableBgp = false
enableRateLimiting = false
routingWeight = 0
useLocalAzureIpAddress = false
usePolicyBasedTrafficSelectors = false
vpnConnectionProtocolType = "IKEv2"
vpnGatewayCustomBgpAddresses = [
]
vpnLinkConnectionMode = "Default"
vpnSiteLink = {
id = data.azapi_resource_id.link2.id
}
}
},
]
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}