Skip to main content

virtual_network_gateways

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

Overview

Namevirtual_network_gateways
TypeResource
Idazure.network.virtual_network_gateways

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
circuitsarrayAll circuits in the peering location.
connectionsarrayAll connections to the circuits in the peering location.
endTimestringTime when the test was completed.
issuesarrayA list of all issues with the test.
peeringLocationstringPeering location of the test.
startTimestringTime when the test was started.
statusstringThe current status of the test. Known values are: "NotStarted", "Starting", "Running", "StartFailed", "Stopping", "Completed", "StopFailed", "Invalid", and "Expired". (NotStarted, Starting, Running, StartFailed, Stopping, Completed, StopFailed, Invalid, Expired)
testGuidstringThe unique GUID associated with the test.
testTypestringThe type of failover test. Known values are: "SingleSiteFailover", "MultiSiteFailover", and "All". (SingleSiteFailover, MultiSiteFailover, All)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_failover_all_test_detailsselectresource_group_name, virtual_network_gateway_name, subscription_id, type, fetchLatestThis operation retrieves the details of all the failover tests performed on the gateway for different peering locations.
get_failover_single_test_detailsselectresource_group_name, virtual_network_gateway_name, subscription_id, peeringLocation, failoverTestIdThis operation retrieves the details of a particular failover test performed on the gateway based on the test Guid.
get_advertised_routesselectresource_group_name, virtual_network_gateway_name, subscription_id, peerThis operation retrieves a list of routes the virtual network gateway is advertising to the specified peer.
getselectresource_group_name, virtual_network_gateway_name, subscription_idGets the specified virtual network gateway by resource group.
listselectresource_group_name, subscription_idGets all virtual network gateways by resource group.
create_or_updateinsertresource_group_name, virtual_network_gateway_name, subscription_id, propertiesCreates or updates a virtual network gateway in the specified resource group.
update_tagsupdateresource_group_name, virtual_network_gateway_name, subscription_idUpdates a virtual network gateway tags.
create_or_updatereplaceresource_group_name, virtual_network_gateway_name, subscription_id, propertiesCreates or updates a virtual network gateway in the specified resource group.
deletedeleteresource_group_name, virtual_network_gateway_name, subscription_idDeletes the specified virtual network gateway.
list_connectionsexecresource_group_name, virtual_network_gateway_name, subscription_idGets all the connections in a virtual network gateway.
list_radius_secretsexecresource_group_name, virtual_network_gateway_name, subscription_idList all Radius servers with respective radius secrets from virtual network gateway VpnClientConfiguration.
get_vpn_profile_package_urlexecresource_group_name, virtual_network_gateway_name, subscription_idGets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile.
get_bgp_peer_statusexecresource_group_name, virtual_network_gateway_name, subscription_idpeerThe GetBgpPeerStatus operation retrieves the status of all BGP peers.
get_learned_routesexecresource_group_name, virtual_network_gateway_name, subscription_idThis operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers.
get_resiliency_informationexecresource_group_name, virtual_network_gateway_name, subscription_idattemptRefreshThis operation retrieves the resiliency information for an Express Route Gateway, including the gateway's current resiliency score and recommendations to further improve the score.
get_routes_informationexecresource_group_name, virtual_network_gateway_name, subscription_idattemptRefreshThis operation retrieves the route set information for an Express Route Gateway based on their resiliency.
get_vpnclient_ipsec_parametersexecresource_group_name, virtual_network_gateway_name, subscription_idThe Get VpnclientIpsecParameters operation retrieves information about the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider.
get_vpnclient_connection_healthexecresource_group_name, virtual_network_gateway_name, subscription_idGet VPN client connection health detail per P2S client connection of the virtual network gateway in the specified resource group.
resetexecresource_group_name, virtual_network_gateway_name, subscription_idgatewayVipResets the primary of the virtual network gateway in the specified resource group.
reset_vpn_client_shared_keyexecresource_group_name, virtual_network_gateway_name, subscription_idResets the VPN client shared key of the virtual network gateway in the specified resource group.
generatevpnclientpackageexecresource_group_name, virtual_network_gateway_name, subscription_idGenerates VPN client package for P2S client of the virtual network gateway in the specified resource group.
generate_vpn_profileexecresource_group_name, virtual_network_gateway_name, subscription_idGenerates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication.
supported_vpn_devicesexecresource_group_name, virtual_network_gateway_name, subscription_idGets a xml format representation for supported vpn devices.
set_vpnclient_ipsec_parametersexecresource_group_name, virtual_network_gateway_name, subscription_id, saLifeTimeSeconds, saDataSizeKilobytes, ipsecEncryption, ipsecIntegrity, ikeEncryption, ikeIntegrity, dhGroup, pfsGroupThe Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource provider.
start_packet_captureexecresource_group_name, virtual_network_gateway_name, subscription_idStarts packet capture on virtual network gateway in the specified resource group.
stop_packet_captureexecresource_group_name, virtual_network_gateway_name, subscription_idStops packet capture on virtual network gateway in the specified resource group.
start_express_route_site_failover_simulationexecresource_group_name, virtual_network_gateway_name, subscription_id, peeringLocationThis operation starts failover simulation on the gateway for the specified peering location.
stop_express_route_site_failover_simulationexecresource_group_name, virtual_network_gateway_name, subscription_idThis operation stops failover simulation on the gateway for the specified peering location.
disconnect_virtual_network_gateway_vpn_connectionsexecresource_group_name, virtual_network_gateway_name, subscription_idDisconnect vpn connections of virtual network gateway in the specified resource group.
invoke_prepare_migrationexecresource_group_name, virtual_network_gateway_name, subscription_id, migrationTypeTrigger prepare migration for the virtual network gateway.
invoke_execute_migrationexecresource_group_name, virtual_network_gateway_name, subscription_idTrigger execute migration for the virtual network gateway.
invoke_commit_migrationexecresource_group_name, virtual_network_gateway_name, subscription_idTrigger commit migration for the virtual network gateway.
invoke_abort_migrationexecresource_group_name, virtual_network_gateway_name, subscription_idTrigger abort migration for the virtual network gateway.
vpn_device_configuration_scriptexecresource_group_name, virtual_network_gateway_connection_name, subscription_idGets a xml format representation for vpn device configuration script.

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
failoverTestIdstringThe unique Guid value which identifies the test. Required.
fetchLatestbooleanFetch only the latest tests for each peering location. Required.
peerstringThe IP address of the peer. Required.
peeringLocationstringPeering location of the test. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
subscription_idstring
typestringThe type of failover test. Required.
virtual_network_gateway_connection_namestringThe name of the virtual network gateway connection. Required.
virtual_network_gateway_namestringThe name of the virtual network gateway. Required.
attemptRefreshbooleanAttempt to recalculate the Route Sets Information for the gateway. Default value is None.
gatewayVipstringVirtual network gateway vip address supplied to the begin reset of the active-active feature enabled gateway. Default value is None.
peerstringThe IP address of the peer to retrieve the status of. Default value is None.

SELECT examples

This operation retrieves the details of all the failover tests performed on the gateway for different peering locations.

SELECT
circuits,
connections,
endTime,
issues,
peeringLocation,
startTime,
status,
testGuid,
testType
FROM azure.network.virtual_network_gateways
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND virtual_network_gateway_name = '{{ virtual_network_gateway_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND type = '{{ type }}' -- required
AND fetchLatest = '{{ fetchLatest }}' -- required
;

INSERT examples

Creates or updates a virtual network gateway in the specified resource group.

INSERT INTO azure.network.virtual_network_gateways (
id,
location,
tags,
properties,
extendedLocation,
identity,
resource_group_name,
virtual_network_gateway_name,
subscription_id
)
SELECT
'{{ id }}',
'{{ location }}',
'{{ tags }}',
'{{ properties }}' /* required */,
'{{ extendedLocation }}',
'{{ identity }}',
'{{ resource_group_name }}',
'{{ virtual_network_gateway_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
etag,
extendedLocation,
identity,
location,
properties,
tags,
type
;

UPDATE examples

Updates a virtual network gateway tags.

UPDATE azure.network.virtual_network_gateways
SET
tags = '{{ tags }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND virtual_network_gateway_name = '{{ virtual_network_gateway_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
etag,
extendedLocation,
identity,
location,
properties,
tags,
type;

REPLACE examples

Creates or updates a virtual network gateway in the specified resource group.

REPLACE azure.network.virtual_network_gateways
SET
id = '{{ id }}',
location = '{{ location }}',
tags = '{{ tags }}',
properties = '{{ properties }}',
extendedLocation = '{{ extendedLocation }}',
identity = '{{ identity }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND virtual_network_gateway_name = '{{ virtual_network_gateway_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND properties = '{{ properties }}' --required
RETURNING
id,
name,
etag,
extendedLocation,
identity,
location,
properties,
tags,
type;

DELETE examples

Deletes the specified virtual network gateway.

DELETE FROM azure.network.virtual_network_gateways
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND virtual_network_gateway_name = '{{ virtual_network_gateway_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;

Lifecycle Methods

Gets all the connections in a virtual network gateway.

EXEC azure.network.virtual_network_gateways.list_connections 
@resource_group_name='{{ resource_group_name }}' --required,
@virtual_network_gateway_name='{{ virtual_network_gateway_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;