Skip to main content

security_groups

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

Overview

Namesecurity_groups
TypeResource
Idazure.network.security_groups

Fields

NameDatatypeDescription
idtextResource ID.
nametextResource name.
default_security_rulestextfield from the properties object
etagtextA unique read-only string that changes whenever the resource is updated.
flow_logstextfield from the properties object
flush_connectiontextfield from the properties object
locationtextResource location.
networkSecurityGroupNametextfield from the properties object
network_interfacestextfield from the properties object
provisioning_statetextfield from the properties object
resourceGroupNametextfield from the properties object
resource_guidtextfield from the properties object
security_rulestextfield from the properties object
subnetstextfield from the properties object
subscriptionIdtextfield from the properties object
tagstextResource tags.
typetextResource type.

Methods

NameAccessible byRequired ParamsDescription
getSELECTnetworkSecurityGroupName, resourceGroupName, subscriptionIdGets the specified network security group.
listSELECTresourceGroupName, subscriptionIdGets all network security groups in a resource group.
list_allSELECTsubscriptionIdGets all network security groups in a subscription.
create_or_updateINSERTnetworkSecurityGroupName, resourceGroupName, subscriptionIdCreates or updates a network security group in the specified resource group.
deleteDELETEnetworkSecurityGroupName, resourceGroupName, subscriptionIdDeletes the specified network security group.
update_tagsEXECnetworkSecurityGroupName, resourceGroupName, subscriptionIdUpdates a network security group tags.

SELECT examples

Gets all network security groups in a subscription.

SELECT
id,
name,
default_security_rules,
etag,
flow_logs,
flush_connection,
location,
networkSecurityGroupName,
network_interfaces,
provisioning_state,
resourceGroupName,
resource_guid,
security_rules,
subnets,
subscriptionId,
tags,
type
FROM azure.network.vw_security_groups
WHERE subscriptionId = '{{ subscriptionId }}';

INSERT example

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

/*+ create */
INSERT INTO azure.network.security_groups (
networkSecurityGroupName,
resourceGroupName,
subscriptionId,
properties,
id,
location,
tags
)
SELECT
'{{ networkSecurityGroupName }}',
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ properties }}',
'{{ id }}',
'{{ location }}',
'{{ tags }}'
;

DELETE example

Deletes the specified security_groups resource.

/*+ delete */
DELETE FROM azure.network.security_groups
WHERE networkSecurityGroupName = '{{ networkSecurityGroupName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';