Skip to main content

subnets

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

Overview

Namesubnets
TypeResource
Idazure.network.subnets

Fields

NameDatatypeDescription
idtextResource ID.
nametextThe name of the resource that is unique within a resource group. This name can be used to access the resource.
address_prefixtextfield from the properties object
address_prefixestextfield from the properties object
application_gateway_ip_configurationstextfield from the properties object
default_outbound_accesstextfield from the properties object
delegationstextfield from the properties object
etagtextA unique read-only string that changes whenever the resource is updated.
ip_allocationstextfield from the properties object
ip_configuration_profilestextfield from the properties object
ip_configurationstextfield from the properties object
nat_gatewaytextfield from the properties object
network_security_grouptextfield from the properties object
private_endpoint_network_policiestextfield from the properties object
private_endpointstextfield from the properties object
private_link_service_network_policiestextfield from the properties object
provisioning_statetextfield from the properties object
purposetextfield from the properties object
resourceGroupNametextfield from the properties object
resource_navigation_linkstextfield from the properties object
route_tabletextfield from the properties object
service_association_linkstextfield from the properties object
service_endpoint_policiestextfield from the properties object
service_endpointstextfield from the properties object
sharing_scopetextfield from the properties object
subnetNametextfield from the properties object
subscriptionIdtextfield from the properties object
typetextResource type.
virtualNetworkNametextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTresourceGroupName, subnetName, subscriptionId, virtualNetworkNameGets the specified subnet by virtual network and resource group.
listSELECTresourceGroupName, subscriptionId, virtualNetworkNameGets all subnets in a virtual network.
create_or_updateINSERTresourceGroupName, subnetName, subscriptionId, virtualNetworkNameCreates or updates a subnet in the specified virtual network.
deleteDELETEresourceGroupName, subnetName, subscriptionId, virtualNetworkNameDeletes the specified subnet.
prepare_network_policiesEXECresourceGroupName, subnetName, subscriptionId, virtualNetworkNamePrepares a subnet by applying network intent policies.
unprepare_network_policiesEXECresourceGroupName, subnetName, subscriptionId, virtualNetworkNameUnprepares a subnet by removing network intent policies.

SELECT examples

Gets all subnets in a virtual network.

SELECT
id,
name,
address_prefix,
address_prefixes,
application_gateway_ip_configurations,
default_outbound_access,
delegations,
etag,
ip_allocations,
ip_configuration_profiles,
ip_configurations,
nat_gateway,
network_security_group,
private_endpoint_network_policies,
private_endpoints,
private_link_service_network_policies,
provisioning_state,
purpose,
resourceGroupName,
resource_navigation_links,
route_table,
service_association_links,
service_endpoint_policies,
service_endpoints,
sharing_scope,
subnetName,
subscriptionId,
type,
virtualNetworkName
FROM azure.network.vw_subnets
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND virtualNetworkName = '{{ virtualNetworkName }}';

INSERT example

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

/*+ create */
INSERT INTO azure.network.subnets (
resourceGroupName,
subnetName,
subscriptionId,
virtualNetworkName,
properties,
name,
type,
id
)
SELECT
'{{ resourceGroupName }}',
'{{ subnetName }}',
'{{ subscriptionId }}',
'{{ virtualNetworkName }}',
'{{ properties }}',
'{{ name }}',
'{{ type }}',
'{{ id }}'
;

DELETE example

Deletes the specified subnets resource.

/*+ delete */
DELETE FROM azure.network.subnets
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND subnetName = '{{ subnetName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND virtualNetworkName = '{{ virtualNetworkName }}';