Skip to main content

virtual_networks

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

Overview

Namevirtual_networks
TypeResource
Idazure.dev_test_labs.virtual_networks

Fields

NameDatatypeDescription
idtextThe identifier of the resource.
nametextThe name of the resource.
descriptiontextfield from the properties object
allowed_subnetstextfield from the properties object
created_datetextfield from the properties object
external_provider_resource_idtextfield from the properties object
external_subnetstextfield from the properties object
labNametextfield from the properties object
locationtextThe location of the resource.
provisioning_statetextfield from the properties object
resourceGroupNametextfield from the properties object
subnet_overridestextfield from the properties object
subscriptionIdtextfield from the properties object
tagstextThe tags of the resource.
typetextThe type of the resource.
unique_identifiertextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTlabName, name, resourceGroupName, subscriptionIdGet virtual network.
listSELECTlabName, resourceGroupName, subscriptionIdList virtual networks in a given lab.
create_or_updateINSERTlabName, name, resourceGroupName, subscriptionIdCreate or replace an existing virtual network. This operation can take a while to complete.
deleteDELETElabName, name, resourceGroupName, subscriptionIdDelete virtual network. This operation can take a while to complete.
updateUPDATElabName, name, resourceGroupName, subscriptionIdAllows modifying tags of virtual networks. All other properties will be ignored.

SELECT examples

List virtual networks in a given lab.

SELECT
id,
name,
description,
allowed_subnets,
created_date,
external_provider_resource_id,
external_subnets,
labName,
location,
provisioning_state,
resourceGroupName,
subnet_overrides,
subscriptionId,
tags,
type,
unique_identifier
FROM azure.dev_test_labs.vw_virtual_networks
WHERE labName = '{{ labName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';

INSERT example

Use the following StackQL query and manifest file to create a new virtual_networks resource.

/*+ create */
INSERT INTO azure.dev_test_labs.virtual_networks (
labName,
name,
resourceGroupName,
subscriptionId,
location,
tags,
properties
)
SELECT
'{{ labName }}',
'{{ name }}',
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ location }}',
'{{ tags }}',
'{{ properties }}'
;

UPDATE example

Updates a virtual_networks resource.

/*+ update */
UPDATE azure.dev_test_labs.virtual_networks
SET
tags = '{{ tags }}'
WHERE
labName = '{{ labName }}'
AND name = '{{ name }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';

DELETE example

Deletes the specified virtual_networks resource.

/*+ delete */
DELETE FROM azure.dev_test_labs.virtual_networks
WHERE labName = '{{ labName }}'
AND name = '{{ name }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';