Skip to main content

virtual_network_peerings

Creates, updates, deletes, gets or lists a virtual_network_peerings resource.

Overview

Namevirtual_network_peerings
TypeResource
Idazure.network.virtual_network_peerings

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringResource ID.
namestringName of the resource.
allowForwardedTrafficbooleanWhether the forwarded traffic from the VMs in the local virtual network will be allowed/disallowed in remote virtual network.
allowGatewayTransitbooleanIf gateway links can be used in remote virtual networking to link to this virtual network.
allowVirtualNetworkAccessbooleanWhether the VMs in the local virtual network space would be able to access the VMs in remote virtual network space.
doNotVerifyRemoteGatewaysbooleanIf we need to verify the provisioning state of the remote gateway.
enableOnlyIPv6PeeringbooleanWhether only Ipv6 address space is peered for subnet peering.
etagstringA unique read-only string that changes whenever the resource is updated.
localAddressSpaceobjectThe local address space of the local virtual network that is peered.
localSubnetNamesarrayList of local subnet names that are subnet peered with remote virtual network.
localVirtualNetworkAddressSpaceobjectThe current local address space of the local virtual network that is peered.
peerCompleteVnetsbooleanWhether complete virtual network address space is peered.
peeringStatestringThe status of the virtual network peering. Known values are: "Initiated", "Connected", and "Disconnected". (Initiated, Connected, Disconnected)
peeringSyncLevelstringThe peering sync status of the virtual network peering. Known values are: "FullyInSync", "RemoteNotInSync", "LocalNotInSync", and "LocalAndRemoteNotInSync". (FullyInSync, RemoteNotInSync, LocalNotInSync, LocalAndRemoteNotInSync)
provisioningStatestringThe provisioning state of the virtual network peering resource. Known values are: "Failed", "Succeeded", "Canceled", "Creating", "Updating", and "Deleting". (Failed, Succeeded, Canceled, Creating, Updating, Deleting)
remoteAddressSpaceobjectThe reference to the address space peered with the remote virtual network.
remoteBgpCommunitiesobjectThe reference to the remote virtual network's Bgp Communities.
remoteSubnetNamesarrayList of remote subnet names from remote virtual network that are subnet peered.
remoteVirtualNetworkobjectReference to another subresource.
remoteVirtualNetworkAddressSpaceobjectThe reference to the current address space of the remote virtual network.
remoteVirtualNetworkEncryptionobjectThe reference to the remote virtual network's encryption.
resourceGuidstringThe resourceGuid property of the Virtual Network peering resource.
typestringResource type.
useRemoteGatewaysbooleanIf 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.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, virtual_network_name, virtual_network_peering_name, subscription_idGets the specified virtual network peering.
listselectresource_group_name, virtual_network_name, subscription_idGets all virtual network peerings in a virtual network.
create_or_updateinsertresource_group_name, virtual_network_name, virtual_network_peering_name, subscription_idsyncRemoteAddressSpaceCreates or updates a peering in the specified virtual network.
create_or_updatereplaceresource_group_name, virtual_network_name, virtual_network_peering_name, subscription_idsyncRemoteAddressSpaceCreates or updates a peering in the specified virtual network.
deletedeleteresource_group_name, virtual_network_name, virtual_network_peering_name, subscription_idDeletes the specified virtual network peering.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
subscription_idstring
virtual_network_namestringThe name of the virtual network. Required.
virtual_network_peering_namestringThe name of the virtual network peering. Required.
syncRemoteAddressSpacestringParameter indicates the intention to sync the peering with the current address space on the remote vNet after it's updated. "true" Default value is None.

SELECT examples

Gets the specified virtual network peering.

SELECT
id,
name,
allowForwardedTraffic,
allowGatewayTransit,
allowVirtualNetworkAccess,
doNotVerifyRemoteGateways,
enableOnlyIPv6Peering,
etag,
localAddressSpace,
localSubnetNames,
localVirtualNetworkAddressSpace,
peerCompleteVnets,
peeringState,
peeringSyncLevel,
provisioningState,
remoteAddressSpace,
remoteBgpCommunities,
remoteSubnetNames,
remoteVirtualNetwork,
remoteVirtualNetworkAddressSpace,
remoteVirtualNetworkEncryption,
resourceGuid,
type,
useRemoteGateways
FROM azure.network.virtual_network_peerings
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND virtual_network_name = '{{ virtual_network_name }}' -- required
AND virtual_network_peering_name = '{{ virtual_network_peering_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Creates or updates a peering in the specified virtual network.

INSERT INTO azure.network.virtual_network_peerings (
id,
name,
properties,
resource_group_name,
virtual_network_name,
virtual_network_peering_name,
subscription_id,
syncRemoteAddressSpace
)
SELECT
'{{ id }}',
'{{ name }}',
'{{ properties }}',
'{{ resource_group_name }}',
'{{ virtual_network_name }}',
'{{ virtual_network_peering_name }}',
'{{ subscription_id }}',
'{{ syncRemoteAddressSpace }}'
RETURNING
id,
name,
etag,
properties,
type
;

REPLACE examples

Creates or updates a peering in the specified virtual network.

REPLACE azure.network.virtual_network_peerings
SET
id = '{{ id }}',
name = '{{ name }}',
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND virtual_network_name = '{{ virtual_network_name }}' --required
AND virtual_network_peering_name = '{{ virtual_network_peering_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND syncRemoteAddressSpace = '{{ syncRemoteAddressSpace}}'
RETURNING
id,
name,
etag,
properties,
type;

DELETE examples

Deletes the specified virtual network peering.

DELETE FROM azure.network.virtual_network_peerings
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND virtual_network_name = '{{ virtual_network_name }}' --required
AND virtual_network_peering_name = '{{ virtual_network_peering_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;