Skip to main content

virtual_networks

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

Overview

Namevirtual_networks
TypeResource
Idazure.network.virtual_networks

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringResource ID.
namestringResource name.
addressSpaceobjectThe AddressSpace that contains an array of IP address ranges that can be used by subnets.
bgpCommunitiesobjectBgp Communities sent over ExpressRoute with each route corresponding to a prefix in this VNET.
ddosProtectionPlanobjectReference to another subresource.
defaultPublicNatGatewayobjectReference to another subresource.
dhcpOptionsobjectThe dhcpOptions that contains an array of DNS servers available to VMs deployed in the virtual network.
enableDdosProtectionbooleanIndicates if DDoS protection is enabled for all the protected resources in the virtual network. It requires a DDoS protection plan associated with the resource.
enableVmProtectionbooleanIndicates if VM protection is enabled for all the subnets in the virtual network.
encryptionobjectIndicates if encryption is enabled on virtual network and if VM without encryption is allowed in encrypted VNet.
etagstringA unique read-only string that changes whenever the resource is updated.
extendedLocationobjectThe extended location of the virtual network.
flowLogsarrayA collection of references to flow log resources.
flowTimeoutInMinutesintegerThe FlowTimeout value (in minutes) for the Virtual Network.
ipAllocationsarrayArray of IpAllocation which reference this VNET.
locationstringResource location.
privateEndpointVNetPoliciesstringPrivate Endpoint VNet Policies. Known values are: "Disabled" and "Basic". (Disabled, Basic)
provisioningStatestringThe provisioning state of the virtual network resource. Known values are: "Failed", "Succeeded", "Canceled", "Creating", "Updating", and "Deleting". (Failed, Succeeded, Canceled, Creating, Updating, Deleting)
resourceGuidstringThe resourceGuid property of the Virtual Network resource.
subnetsarrayA list of subnets in a Virtual Network.
summarizedGatewayPrefixesobjectA configurable list of summarized gateway prefixes advertised for the virtual network.
tagsobjectResource tags.
typestringResource type.
virtualNetworkPeeringsarrayA list of peerings in a Virtual Network.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, virtual_network_name, subscription_id$expandGets the specified virtual network by resource group.
listselectresource_group_name, subscription_idGets all virtual networks in a resource group.
list_allselectsubscription_idGets all virtual networks in a subscription.
create_or_updateinsertresource_group_name, virtual_network_name, subscription_idCreates or updates a virtual network in the specified resource group.
update_tagsupdateresource_group_name, virtual_network_name, subscription_idUpdates a virtual network tags.
create_or_updatereplaceresource_group_name, virtual_network_name, subscription_idCreates or updates a virtual network in the specified resource group.
deletedeleteresource_group_name, virtual_network_name, subscription_idDeletes the specified virtual network.
list_usageexecresource_group_name, virtual_network_name, subscription_idLists usage stats.
list_ddos_protection_statusexecresource_group_name, virtual_network_name, subscription_idtop, skipTokenGets the Ddos Protection Status of all IP Addresses under the Virtual Network.
check_ip_address_availabilityexecresource_group_name, virtual_network_name, subscription_id, ipAddressChecks whether a private IP address is available for use.

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
ipAddressstringThe private IP address to be verified. Required.
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.
$expandstringExpands referenced resources. Default value is None.
skipTokenstringThe skipToken that is given with nextLink. Default value is None.
topintegerThe max number of ip addresses to return. Default value is None.

SELECT examples

Gets the specified virtual network by resource group.

SELECT
id,
name,
addressSpace,
bgpCommunities,
ddosProtectionPlan,
defaultPublicNatGateway,
dhcpOptions,
enableDdosProtection,
enableVmProtection,
encryption,
etag,
extendedLocation,
flowLogs,
flowTimeoutInMinutes,
ipAllocations,
location,
privateEndpointVNetPolicies,
provisioningState,
resourceGuid,
subnets,
summarizedGatewayPrefixes,
tags,
type,
virtualNetworkPeerings
FROM azure.network.virtual_networks
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND virtual_network_name = '{{ virtual_network_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND $expand = '{{ $expand }}'
;

INSERT examples

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

INSERT INTO azure.network.virtual_networks (
id,
location,
tags,
properties,
extendedLocation,
resource_group_name,
virtual_network_name,
subscription_id
)
SELECT
'{{ id }}',
'{{ location }}',
'{{ tags }}',
'{{ properties }}',
'{{ extendedLocation }}',
'{{ resource_group_name }}',
'{{ virtual_network_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
etag,
extendedLocation,
location,
properties,
tags,
type
;

UPDATE examples

Updates a virtual network tags.

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

REPLACE examples

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

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

DELETE examples

Deletes the specified virtual network.

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

Lifecycle Methods

Lists usage stats.

EXEC azure.network.virtual_networks.list_usage 
@resource_group_name='{{ resource_group_name }}' --required,
@virtual_network_name='{{ virtual_network_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;