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:

Request successful. The operation returns the resulting VirtualNetworkPeering resource.

NameDatatypeDescription
idstringResource ID.
namestringThe name of the resource that is unique within a resource group. This name can be used to access the resource.
etagstringA unique read-only string that changes whenever the resource is updated.
propertiesobjectProperties of the virtual network peering.
typestringResource type.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresourceGroupName, virtualNetworkName, virtualNetworkPeeringName, subscriptionIdGets the specified virtual network peering.
listselectresourceGroupName, virtualNetworkName, subscriptionIdGets all virtual network peerings in a virtual network.
create_or_updateinsertresourceGroupName, virtualNetworkName, virtualNetworkPeeringName, subscriptionIdsyncRemoteAddressSpaceCreates or updates a peering in the specified virtual network.
deletedeleteresourceGroupName, virtualNetworkName, virtualNetworkPeeringName, subscriptionIdDeletes 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
resourceGroupNamestringThe name of the resource group.
subscriptionIdstring (uuid)The ID of the target subscription. The value must be an UUID.
virtualNetworkNamestringThe name of the virtual network.
virtualNetworkPeeringNamestringThe name of the virtual network peering.
syncRemoteAddressSpacestringParameter indicates the intention to sync the peering with the current address space on the remote vNet after it's updated.

SELECT examples

Gets the specified virtual network peering.

SELECT
id,
name,
etag,
properties,
type
FROM azure.network.virtual_network_peerings
WHERE resourceGroupName = '{{ resourceGroupName }}' -- required
AND virtualNetworkName = '{{ virtualNetworkName }}' -- required
AND virtualNetworkPeeringName = '{{ virtualNetworkPeeringName }}' -- required
AND subscriptionId = '{{ subscriptionId }}' -- required
;

INSERT examples

Creates or updates a peering in the specified virtual network.

INSERT INTO azure.network.virtual_network_peerings (
data__properties,
data__name,
data__type,
data__id,
resourceGroupName,
virtualNetworkName,
virtualNetworkPeeringName,
subscriptionId,
syncRemoteAddressSpace
)
SELECT
'{{ properties }}',
'{{ name }}',
'{{ type }}',
'{{ id }}',
'{{ resourceGroupName }}',
'{{ virtualNetworkName }}',
'{{ virtualNetworkPeeringName }}',
'{{ subscriptionId }}',
'{{ syncRemoteAddressSpace }}'
RETURNING
id,
name,
etag,
properties,
type
;

DELETE examples

Deletes the specified virtual network peering.

DELETE FROM azure.network.virtual_network_peerings
WHERE resourceGroupName = '{{ resourceGroupName }}' --required
AND virtualNetworkName = '{{ virtualNetworkName }}' --required
AND virtualNetworkPeeringName = '{{ virtualNetworkPeeringName }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
;