Microsoft.Network virtualNetworks/virtualNetworkPeerings template reference
Template format
To create a Microsoft.Network/virtualNetworks/virtualNetworkPeerings resource, add the following JSON to the resources section of your template.
{
"name": "string",
"type": "Microsoft.Network/virtualNetworks/virtualNetworkPeerings",
"apiVersion": "2019-06-01",
"properties": {
"allowVirtualNetworkAccess": "boolean",
"allowForwardedTraffic": "boolean",
"allowGatewayTransit": "boolean",
"useRemoteGateways": "boolean",
"remoteVirtualNetwork": {
"id": "string"
},
"remoteAddressSpace": {
"addressPrefixes": [
"string"
]
},
"peeringState": "string"
}
}
Property values
The following tables describe the values you need to set in the schema.
Microsoft.Network/virtualNetworks/virtualNetworkPeerings object
Name | Type | Required | Value |
---|---|---|---|
name | string | Yes | The name of the peering. |
type | enum | Yes | virtualNetworkPeerings -or- Microsoft.Network/virtualNetworks/virtualNetworkPeerings See Set name and type for child resources. |
apiVersion | enum | Yes | 2019-06-01 |
properties | object | Yes | Properties of the virtual network peering. - VirtualNetworkPeeringPropertiesFormat object |
VirtualNetworkPeeringPropertiesFormat object
Name | Type | Required | Value |
---|---|---|---|
allowVirtualNetworkAccess | boolean | No | Whether the VMs in the local virtual network space would be able to access the VMs in remote virtual network space. |
allowForwardedTraffic | boolean | No | Whether the forwarded traffic from the VMs in the local virtual network will be allowed/disallowed in remote virtual network. |
allowGatewayTransit | boolean | No | If gateway links can be used in remote virtual networking to link to this virtual network. |
useRemoteGateways | boolean | No | If remote gateways can be used on this virtual network. If the flag is set to true, and allowGatewayTransit on remote peering is also true, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network already has a gateway. |
remoteVirtualNetwork | object | No | The reference of the remote virtual network. The remote virtual network can be in the same or different region (preview). See here to register for the preview and learn more (https://docs.microsoft.com/azure/virtual-network/virtual-network-create-peering). - SubResource object |
remoteAddressSpace | object | No | The reference of the remote virtual network address space. - AddressSpace object |
peeringState | enum | No | The status of the virtual network peering. - Initiated, Connected, Disconnected |
SubResource object
Name | Type | Required | Value |
---|---|---|---|
id | string | No | Resource ID. |
AddressSpace object
Name | Type | Required | Value |
---|---|---|---|
addressPrefixes | array | No | A list of address blocks reserved for this virtual network in CIDR notation. - string |
Quickstart templates
The following quickstart templates deploy this resource type.
Template | Description |
---|---|
Create an Azure Firewall sandbox with forced tunneling |
This template creates an Azure Firewall sandbox (Linux) with one firewall force tunneled through another firewall in a peered VNET |
Deploy HBase replication with two VNets in one region |
This template allows you to configure aN HBase environment with two HBase clusters within two VNets in the same region for configuring HBase replication. |
Deploy a Hub and Spoke topology sandbox |
This template creates a basic hub-and-spoke topology setup. It creates a Hub VNet with subnets DMZ, Management, Shared and Gateway (optionally), with two Spoke VNets (development and production) containing a workload subnet each. It also deploys a Windows Jump-Host on the Management subnet of the HUB, and establishes VNet peerings between the Hub and the two spokes. |
Peer two existing VNets within a single region |
This template allows you to connect two VNETs from the same or different resource groups in the same region using VNet Peering |
Create a vNet to vNet connection using vNet Peering |
This template allows you to connect two vNets using vNet Peering |