Skip to main content

virtual_hubs

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

Overview

Namevirtual_hubs
TypeResource
Idazure.network.virtual_hubs

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringResource ID.
namestringResource name.
addressPrefixstringAddress-prefix for this VirtualHub.
allowBranchToBranchTrafficbooleanFlag to control transit for VirtualRouter hub.
azureFirewallobjectReference to another subresource.
bgpConnectionsarrayList of references to Bgp Connections.
etagstringA unique read-only string that changes whenever the resource is updated.
expressRouteGatewayobjectReference to another subresource.
hubRoutingPreferencestringThe hubRoutingPreference of this VirtualHub. Known values are: "ExpressRoute", "VpnGateway", and "ASPath". (ExpressRoute, VpnGateway, ASPath)
ipConfigurationsarrayList of references to IpConfigurations.
kindstringKind of service virtual hub. This is metadata used for the Azure portal experience for Route Server.
locationstringResource location.
p2SVpnGatewayobjectReference to another subresource.
preferredRoutingGatewaystringThe preferred gateway to route on-prem traffic. Known values are: "ExpressRoute", "VpnGateway", and "None". (ExpressRoute, VpnGateway, None)
provisioningStatestringThe provisioning state of the virtual hub resource. Known values are: "Failed", "Succeeded", "Canceled", "Creating", "Updating", and "Deleting". (Failed, Succeeded, Canceled, Creating, Updating, Deleting)
routeMapsarrayList of references to RouteMaps.
routeTableobjectThe routeTable associated with this virtual hub.
routingStatestringThe routing state. Known values are: "None", "Provisioned", "Provisioning", and "Failed". (None, Provisioned, Provisioning, Failed)
securityPartnerProviderobjectReference to another subresource.
securityProviderNamestringThe Security Provider name.
skustringThe sku of this VirtualHub.
tagsobjectResource tags.
typestringResource type.
virtualHubRouteTableV2sarrayList of all virtual hub route table v2s associated with this VirtualHub.
virtualRouterAsnintegerVirtualRouter ASN.
virtualRouterAutoScaleConfigurationobjectThe VirtualHub Router autoscale configuration.
virtualRouterIpsarrayVirtualRouter IPs.
virtualWanobjectReference to another subresource.
vpnGatewayobjectReference to another subresource.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, virtual_hub_name, subscription_idRetrieves the details of a VirtualHub.
list_by_resource_groupselectresource_group_name, subscription_idLists all the VirtualHubs in a resource group.
listselectsubscription_idLists all the VirtualHubs in a subscription.
create_or_updateinsertresource_group_name, virtual_hub_name, subscription_idCreates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub.
update_tagsupdateresource_group_name, virtual_hub_name, subscription_idUpdates VirtualHub tags.
create_or_updatereplaceresource_group_name, virtual_hub_name, subscription_idCreates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub.
deletedeleteresource_group_name, virtual_hub_name, subscription_idDeletes a VirtualHub.
get_effective_virtual_hub_routesexecresource_group_name, virtual_hub_name, subscription_idGets the effective routes configured for the Virtual Hub resource or the specified resource .
get_inbound_routesexecresource_group_name, virtual_hub_name, subscription_idGets the inbound routes configured for the Virtual Hub on a particular connection.
get_outbound_routesexecresource_group_name, virtual_hub_name, subscription_idGets the outbound routes configured for the Virtual Hub on a particular connection.

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_hub_namestringThe name of the VirtualHub. Required.

SELECT examples

Retrieves the details of a VirtualHub.

SELECT
id,
name,
addressPrefix,
allowBranchToBranchTraffic,
azureFirewall,
bgpConnections,
etag,
expressRouteGateway,
hubRoutingPreference,
ipConfigurations,
kind,
location,
p2SVpnGateway,
preferredRoutingGateway,
provisioningState,
routeMaps,
routeTable,
routingState,
securityPartnerProvider,
securityProviderName,
sku,
tags,
type,
virtualHubRouteTableV2s,
virtualRouterAsn,
virtualRouterAutoScaleConfiguration,
virtualRouterIps,
virtualWan,
vpnGateway
FROM azure.network.virtual_hubs
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND virtual_hub_name = '{{ virtual_hub_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub.

INSERT INTO azure.network.virtual_hubs (
id,
location,
tags,
properties,
resource_group_name,
virtual_hub_name,
subscription_id
)
SELECT
'{{ id }}',
'{{ location }}',
'{{ tags }}',
'{{ properties }}',
'{{ resource_group_name }}',
'{{ virtual_hub_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
etag,
kind,
location,
properties,
tags,
type
;

UPDATE examples

Updates VirtualHub tags.

UPDATE azure.network.virtual_hubs
SET
tags = '{{ tags }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND virtual_hub_name = '{{ virtual_hub_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
etag,
kind,
location,
properties,
tags,
type;

REPLACE examples

Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub.

REPLACE azure.network.virtual_hubs
SET
id = '{{ id }}',
location = '{{ location }}',
tags = '{{ tags }}',
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND virtual_hub_name = '{{ virtual_hub_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
etag,
kind,
location,
properties,
tags,
type;

DELETE examples

Deletes a VirtualHub.

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

Lifecycle Methods

Gets the effective routes configured for the Virtual Hub resource or the specified resource .

EXEC azure.network.virtual_hubs.get_effective_virtual_hub_routes 
@resource_group_name='{{ resource_group_name }}' --required,
@virtual_hub_name='{{ virtual_hub_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"resourceId": "{{ resourceId }}",
"virtualWanResourceType": "{{ virtualWanResourceType }}"
}'
;