Skip to main content

network_security_groups

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

Overview

Namenetwork_security_groups
TypeResource
Idazure.network.network_security_groups

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringResource ID.
namestringResource name.
defaultSecurityRulesarrayThe default security rules of network security group.
etagstringA unique read-only string that changes whenever the resource is updated.
flowLogsarrayA collection of references to flow log resources.
flushConnectionbooleanWhen enabled, flows created from Network Security Group connections will be re-evaluated when rules are updates. Initial enablement will trigger re-evaluation.
locationstringResource location.
networkInterfacesarrayA collection of references to network interfaces.
provisioningStatestringThe provisioning state of the network security group resource. Known values are: "Failed", "Succeeded", "Canceled", "Creating", "Updating", and "Deleting". (Failed, Succeeded, Canceled, Creating, Updating, Deleting)
resourceGuidstringThe resource GUID property of the network security group resource.
securityRulesarrayA collection of security rules of the network security group.
subnetsarrayA collection of references to subnets.
tagsobjectResource tags.
typestringResource type.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, network_security_group_name, subscription_id$expandGets the specified network security group.
listselectresource_group_name, subscription_idGets all network security groups in a resource group.
list_allselectsubscription_idGets all network security groups in a subscription.
create_or_updateinsertresource_group_name, network_security_group_name, subscription_idCreates or updates a network security group in the specified resource group.
update_tagsupdateresource_group_name, network_security_group_name, subscription_idUpdates a network security group tags.
create_or_updatereplaceresource_group_name, network_security_group_name, subscription_idCreates or updates a network security group in the specified resource group.
deletedeleteresource_group_name, network_security_group_name, subscription_idDeletes the specified network security group.

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
network_security_group_namestringThe name of the network security group. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
subscription_idstring
$expandstringExpands referenced resources. Default value is None.

SELECT examples

Gets the specified network security group.

SELECT
id,
name,
defaultSecurityRules,
etag,
flowLogs,
flushConnection,
location,
networkInterfaces,
provisioningState,
resourceGuid,
securityRules,
subnets,
tags,
type
FROM azure.network.network_security_groups
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND network_security_group_name = '{{ network_security_group_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND $expand = '{{ $expand }}'
;

INSERT examples

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

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

UPDATE examples

Updates a network security group tags.

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

REPLACE examples

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

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

DELETE examples

Deletes the specified network security group.

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