network_security_groups
Creates, updates, deletes, gets or lists a network_security_groups resource.
Overview
| Name | network_security_groups |
| Type | Resource |
| Id | azure.network.network_security_groups |
Fields
The following fields are returned by SELECT queries:
- get
- list
- list_all
| Name | Datatype | Description |
|---|---|---|
id | string | Resource ID. |
name | string | Resource name. |
defaultSecurityRules | array | The default security rules of network security group. |
etag | string | A unique read-only string that changes whenever the resource is updated. |
flowLogs | array | A collection of references to flow log resources. |
flushConnection | boolean | When enabled, flows created from Network Security Group connections will be re-evaluated when rules are updates. Initial enablement will trigger re-evaluation. |
location | string | Resource location. |
networkInterfaces | array | A collection of references to network interfaces. |
provisioningState | string | The provisioning state of the network security group resource. Known values are: "Failed", "Succeeded", "Canceled", "Creating", "Updating", and "Deleting". (Failed, Succeeded, Canceled, Creating, Updating, Deleting) |
resourceGuid | string | The resource GUID property of the network security group resource. |
securityRules | array | A collection of security rules of the network security group. |
subnets | array | A collection of references to subnets. |
tags | object | Resource tags. |
type | string | Resource type. |
| Name | Datatype | Description |
|---|---|---|
id | string | Resource ID. |
name | string | Resource name. |
defaultSecurityRules | array | The default security rules of network security group. |
etag | string | A unique read-only string that changes whenever the resource is updated. |
flowLogs | array | A collection of references to flow log resources. |
flushConnection | boolean | When enabled, flows created from Network Security Group connections will be re-evaluated when rules are updates. Initial enablement will trigger re-evaluation. |
location | string | Resource location. |
networkInterfaces | array | A collection of references to network interfaces. |
provisioningState | string | The provisioning state of the network security group resource. Known values are: "Failed", "Succeeded", "Canceled", "Creating", "Updating", and "Deleting". (Failed, Succeeded, Canceled, Creating, Updating, Deleting) |
resourceGuid | string | The resource GUID property of the network security group resource. |
securityRules | array | A collection of security rules of the network security group. |
subnets | array | A collection of references to subnets. |
tags | object | Resource tags. |
type | string | Resource type. |
| Name | Datatype | Description |
|---|---|---|
id | string | Resource ID. |
name | string | Resource name. |
defaultSecurityRules | array | The default security rules of network security group. |
etag | string | A unique read-only string that changes whenever the resource is updated. |
flowLogs | array | A collection of references to flow log resources. |
flushConnection | boolean | When enabled, flows created from Network Security Group connections will be re-evaluated when rules are updates. Initial enablement will trigger re-evaluation. |
location | string | Resource location. |
networkInterfaces | array | A collection of references to network interfaces. |
provisioningState | string | The provisioning state of the network security group resource. Known values are: "Failed", "Succeeded", "Canceled", "Creating", "Updating", and "Deleting". (Failed, Succeeded, Canceled, Creating, Updating, Deleting) |
resourceGuid | string | The resource GUID property of the network security group resource. |
securityRules | array | A collection of security rules of the network security group. |
subnets | array | A collection of references to subnets. |
tags | object | Resource tags. |
type | string | Resource type. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | resource_group_name, network_security_group_name, subscription_id | $expand | Gets the specified network security group. |
list | select | resource_group_name, subscription_id | Gets all network security groups in a resource group. | |
list_all | select | subscription_id | Gets all network security groups in a subscription. | |
create_or_update | insert | resource_group_name, network_security_group_name, subscription_id | Creates or updates a network security group in the specified resource group. | |
update_tags | update | resource_group_name, network_security_group_name, subscription_id | Updates a network security group tags. | |
create_or_update | replace | resource_group_name, network_security_group_name, subscription_id | Creates or updates a network security group in the specified resource group. | |
delete | delete | resource_group_name, network_security_group_name, subscription_id | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
network_security_group_name | string | The name of the network security group. Required. |
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
subscription_id | string | |
$expand | string | Expands referenced resources. Default value is None. |
SELECT examples
- get
- list
- list_all
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 }}'
;
Gets all network security groups in a resource 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 subscription_id = '{{ subscription_id }}' -- required
;
Gets all network security groups in a subscription.
SELECT
id,
name,
defaultSecurityRules,
etag,
flowLogs,
flushConnection,
location,
networkInterfaces,
provisioningState,
resourceGuid,
securityRules,
subnets,
tags,
type
FROM azure.network.network_security_groups
WHERE subscription_id = '{{ subscription_id }}' -- required
;
INSERT examples
- create_or_update
- Manifest
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
;
# Description fields are for documentation purposes
- name: network_security_groups
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the network_security_groups resource.
- name: network_security_group_name
value: "{{ network_security_group_name }}"
description: Required parameter for the network_security_groups resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the network_security_groups resource.
- name: id
value: "{{ id }}"
description: |
Resource ID.
- name: location
value: "{{ location }}"
description: |
Resource location.
- name: tags
value: "{{ tags }}"
description: |
Resource tags.
- name: properties
description: |
Properties of the network security group.
value:
flushConnection: {{ flushConnection }}
securityRules:
- id: "{{ id }}"
name: "{{ name }}"
type: "{{ type }}"
properties:
description: "{{ description }}"
protocol: "{{ protocol }}"
sourcePortRange: "{{ sourcePortRange }}"
destinationPortRange: "{{ destinationPortRange }}"
sourceAddressPrefix: "{{ sourceAddressPrefix }}"
sourceAddressPrefixes:
- "{{ sourceAddressPrefixes }}"
sourceApplicationSecurityGroups:
- id: "{{ id }}"
name: "{{ name }}"
type: "{{ type }}"
location: "{{ location }}"
tags: "{{ tags }}"
properties:
resourceGuid: "{{ resourceGuid }}"
provisioningState: "{{ provisioningState }}"
etag: "{{ etag }}"
destinationAddressPrefix: "{{ destinationAddressPrefix }}"
destinationAddressPrefixes:
- "{{ destinationAddressPrefixes }}"
destinationApplicationSecurityGroups:
- id: "{{ id }}"
name: "{{ name }}"
type: "{{ type }}"
location: "{{ location }}"
tags: "{{ tags }}"
properties:
resourceGuid: "{{ resourceGuid }}"
provisioningState: "{{ provisioningState }}"
etag: "{{ etag }}"
sourcePortRanges:
- "{{ sourcePortRanges }}"
destinationPortRanges:
- "{{ destinationPortRanges }}"
access: "{{ access }}"
priority: {{ priority }}
direction: "{{ direction }}"
provisioningState: "{{ provisioningState }}"
etag: "{{ etag }}"
defaultSecurityRules:
- id: "{{ id }}"
name: "{{ name }}"
type: "{{ type }}"
properties:
description: "{{ description }}"
protocol: "{{ protocol }}"
sourcePortRange: "{{ sourcePortRange }}"
destinationPortRange: "{{ destinationPortRange }}"
sourceAddressPrefix: "{{ sourceAddressPrefix }}"
sourceAddressPrefixes:
- "{{ sourceAddressPrefixes }}"
sourceApplicationSecurityGroups:
- id: "{{ id }}"
name: "{{ name }}"
type: "{{ type }}"
location: "{{ location }}"
tags: "{{ tags }}"
properties:
resourceGuid: "{{ resourceGuid }}"
provisioningState: "{{ provisioningState }}"
etag: "{{ etag }}"
destinationAddressPrefix: "{{ destinationAddressPrefix }}"
destinationAddressPrefixes:
- "{{ destinationAddressPrefixes }}"
destinationApplicationSecurityGroups:
- id: "{{ id }}"
name: "{{ name }}"
type: "{{ type }}"
location: "{{ location }}"
tags: "{{ tags }}"
properties:
resourceGuid: "{{ resourceGuid }}"
provisioningState: "{{ provisioningState }}"
etag: "{{ etag }}"
sourcePortRanges:
- "{{ sourcePortRanges }}"
destinationPortRanges:
- "{{ destinationPortRanges }}"
access: "{{ access }}"
priority: {{ priority }}
direction: "{{ direction }}"
provisioningState: "{{ provisioningState }}"
etag: "{{ etag }}"
networkInterfaces:
- id: "{{ id }}"
name: "{{ name }}"
type: "{{ type }}"
location: "{{ location }}"
tags: "{{ tags }}"
properties:
virtualMachine:
id: "{{ id }}"
networkSecurityGroup:
id: "{{ id }}"
name: "{{ name }}"
type: "{{ type }}"
location: "{{ location }}"
tags: "{{ tags }}"
properties:
flushConnection: {{ flushConnection }}
securityRules: "{{ securityRules }}"
defaultSecurityRules: "{{ defaultSecurityRules }}"
networkInterfaces: "{{ networkInterfaces }}"
subnets: "{{ subnets }}"
flowLogs: "{{ flowLogs }}"
resourceGuid: "{{ resourceGuid }}"
provisioningState: "{{ provisioningState }}"
etag: "{{ etag }}"
privateEndpoint:
id: "{{ id }}"
name: "{{ name }}"
type: "{{ type }}"
location: "{{ location }}"
tags: "{{ tags }}"
properties:
subnet: "{{ subnet }}"
networkInterfaces: "{{ networkInterfaces }}"
provisioningState: "{{ provisioningState }}"
ipVersionType: "{{ ipVersionType }}"
privateLinkServiceConnections: "{{ privateLinkServiceConnections }}"
manualPrivateLinkServiceConnections: "{{ manualPrivateLinkServiceConnections }}"
customDnsConfigs: "{{ customDnsConfigs }}"
applicationSecurityGroups: "{{ applicationSecurityGroups }}"
ipConfigurations: "{{ ipConfigurations }}"
customNetworkInterfaceName: "{{ customNetworkInterfaceName }}"
billingSku: "{{ billingSku }}"
extendedLocation:
name: "{{ name }}"
type: "{{ type }}"
etag: "{{ etag }}"
ipConfigurations:
- id: "{{ id }}"
name: "{{ name }}"
type: "{{ type }}"
properties:
gatewayLoadBalancer: "{{ gatewayLoadBalancer }}"
virtualNetworkTaps: "{{ virtualNetworkTaps }}"
applicationGatewayBackendAddressPools: "{{ applicationGatewayBackendAddressPools }}"
loadBalancerBackendAddressPools: "{{ loadBalancerBackendAddressPools }}"
loadBalancerInboundNatRules: "{{ loadBalancerInboundNatRules }}"
privateIPAddress: "{{ privateIPAddress }}"
privateIPAddressPrefixLength: {{ privateIPAddressPrefixLength }}
privateIPAllocationMethod: "{{ privateIPAllocationMethod }}"
privateIPAddressVersion: "{{ privateIPAddressVersion }}"
subnet: "{{ subnet }}"
primary: {{ primary }}
publicIPAddress: "{{ publicIPAddress }}"
applicationSecurityGroups: "{{ applicationSecurityGroups }}"
provisioningState: "{{ provisioningState }}"
privateLinkConnectionProperties: "{{ privateLinkConnectionProperties }}"
etag: "{{ etag }}"
tapConfigurations:
- id: "{{ id }}"
name: "{{ name }}"
type: "{{ type }}"
properties:
virtualNetworkTap: "{{ virtualNetworkTap }}"
provisioningState: "{{ provisioningState }}"
etag: "{{ etag }}"
dnsSettings:
dnsServers:
- "{{ dnsServers }}"
appliedDnsServers:
- "{{ appliedDnsServers }}"
internalDnsNameLabel: "{{ internalDnsNameLabel }}"
internalFqdn: "{{ internalFqdn }}"
internalDomainNameSuffix: "{{ internalDomainNameSuffix }}"
macAddress: "{{ macAddress }}"
primary: {{ primary }}
vnetEncryptionSupported: {{ vnetEncryptionSupported }}
defaultOutboundConnectivityEnabled: {{ defaultOutboundConnectivityEnabled }}
enableAcceleratedNetworking: {{ enableAcceleratedNetworking }}
disableTcpStateTracking: {{ disableTcpStateTracking }}
enableIPForwarding: {{ enableIPForwarding }}
hostedWorkloads:
- "{{ hostedWorkloads }}"
dscpConfiguration:
id: "{{ id }}"
resourceGuid: "{{ resourceGuid }}"
provisioningState: "{{ provisioningState }}"
workloadType: "{{ workloadType }}"
nicType: "{{ nicType }}"
privateLinkService:
id: "{{ id }}"
name: "{{ name }}"
type: "{{ type }}"
location: "{{ location }}"
tags: "{{ tags }}"
properties:
loadBalancerFrontendIpConfigurations: "{{ loadBalancerFrontendIpConfigurations }}"
ipConfigurations: "{{ ipConfigurations }}"
destinationIPAddress: "{{ destinationIPAddress }}"
accessMode: "{{ accessMode }}"
networkInterfaces: "{{ networkInterfaces }}"
provisioningState: "{{ provisioningState }}"
privateEndpointConnections: "{{ privateEndpointConnections }}"
visibility: "{{ visibility }}"
autoApproval: "{{ autoApproval }}"
fqdns: "{{ fqdns }}"
alias: "{{ alias }}"
enableProxyProtocol: {{ enableProxyProtocol }}
extendedLocation:
name: "{{ name }}"
type: "{{ type }}"
etag: "{{ etag }}"
migrationPhase: "{{ migrationPhase }}"
auxiliaryMode: "{{ auxiliaryMode }}"
auxiliarySku: "{{ auxiliarySku }}"
extendedLocation:
name: "{{ name }}"
type: "{{ type }}"
etag: "{{ etag }}"
subnets:
- id: "{{ id }}"
name: "{{ name }}"
type: "{{ type }}"
properties:
addressPrefix: "{{ addressPrefix }}"
addressPrefixes:
- "{{ addressPrefixes }}"
networkSecurityGroup:
id: "{{ id }}"
name: "{{ name }}"
type: "{{ type }}"
location: "{{ location }}"
tags: "{{ tags }}"
properties:
flushConnection: {{ flushConnection }}
securityRules: "{{ securityRules }}"
defaultSecurityRules: "{{ defaultSecurityRules }}"
networkInterfaces: "{{ networkInterfaces }}"
subnets: "{{ subnets }}"
flowLogs: "{{ flowLogs }}"
resourceGuid: "{{ resourceGuid }}"
provisioningState: "{{ provisioningState }}"
etag: "{{ etag }}"
routeTable:
id: "{{ id }}"
name: "{{ name }}"
type: "{{ type }}"
location: "{{ location }}"
tags: "{{ tags }}"
properties:
routes: "{{ routes }}"
subnets: "{{ subnets }}"
disableBgpRoutePropagation: {{ disableBgpRoutePropagation }}
disablePeeringRoute: "{{ disablePeeringRoute }}"
provisioningState: "{{ provisioningState }}"
resourceGuid: "{{ resourceGuid }}"
etag: "{{ etag }}"
natGateway:
id: "{{ id }}"
serviceEndpoints:
- service: "{{ service }}"
networkIdentifier:
id: "{{ id }}"
locations: "{{ locations }}"
provisioningState: "{{ provisioningState }}"
serviceEndpointPolicies:
- id: "{{ id }}"
name: "{{ name }}"
type: "{{ type }}"
location: "{{ location }}"
tags: "{{ tags }}"
properties:
serviceEndpointPolicyDefinitions: "{{ serviceEndpointPolicyDefinitions }}"
subnets: "{{ subnets }}"
resourceGuid: "{{ resourceGuid }}"
provisioningState: "{{ provisioningState }}"
serviceAlias: "{{ serviceAlias }}"
contextualServiceEndpointPolicies: "{{ contextualServiceEndpointPolicies }}"
etag: "{{ etag }}"
kind: "{{ kind }}"
privateEndpoints:
- id: "{{ id }}"
name: "{{ name }}"
type: "{{ type }}"
location: "{{ location }}"
tags: "{{ tags }}"
properties:
subnet: "{{ subnet }}"
networkInterfaces: "{{ networkInterfaces }}"
provisioningState: "{{ provisioningState }}"
ipVersionType: "{{ ipVersionType }}"
privateLinkServiceConnections: "{{ privateLinkServiceConnections }}"
manualPrivateLinkServiceConnections: "{{ manualPrivateLinkServiceConnections }}"
customDnsConfigs: "{{ customDnsConfigs }}"
applicationSecurityGroups: "{{ applicationSecurityGroups }}"
ipConfigurations: "{{ ipConfigurations }}"
customNetworkInterfaceName: "{{ customNetworkInterfaceName }}"
billingSku: "{{ billingSku }}"
extendedLocation:
name: "{{ name }}"
type: "{{ type }}"
etag: "{{ etag }}"
ipConfigurations:
- id: "{{ id }}"
properties:
privateIPAddress: "{{ privateIPAddress }}"
privateIPAllocationMethod: "{{ privateIPAllocationMethod }}"
subnet: "{{ subnet }}"
publicIPAddress: "{{ publicIPAddress }}"
provisioningState: "{{ provisioningState }}"
name: "{{ name }}"
etag: "{{ etag }}"
ipConfigurationProfiles:
- id: "{{ id }}"
properties:
subnet: "{{ subnet }}"
provisioningState: "{{ provisioningState }}"
name: "{{ name }}"
type: "{{ type }}"
etag: "{{ etag }}"
ipAllocations:
- id: "{{ id }}"
resourceNavigationLinks:
- id: "{{ id }}"
properties:
linkedResourceType: "{{ linkedResourceType }}"
link: "{{ link }}"
provisioningState: "{{ provisioningState }}"
name: "{{ name }}"
etag: "{{ etag }}"
type: "{{ type }}"
serviceAssociationLinks:
- id: "{{ id }}"
properties:
linkedResourceType: "{{ linkedResourceType }}"
link: "{{ link }}"
provisioningState: "{{ provisioningState }}"
allowDelete: {{ allowDelete }}
locations: "{{ locations }}"
name: "{{ name }}"
etag: "{{ etag }}"
type: "{{ type }}"
delegations:
- id: "{{ id }}"
properties:
serviceName: "{{ serviceName }}"
actions: "{{ actions }}"
provisioningState: "{{ provisioningState }}"
name: "{{ name }}"
etag: "{{ etag }}"
type: "{{ type }}"
purpose: "{{ purpose }}"
provisioningState: "{{ provisioningState }}"
privateEndpointNetworkPolicies: "{{ privateEndpointNetworkPolicies }}"
privateLinkServiceNetworkPolicies: "{{ privateLinkServiceNetworkPolicies }}"
applicationGatewayIPConfigurations:
- id: "{{ id }}"
properties:
subnet: "{{ subnet }}"
provisioningState: "{{ provisioningState }}"
name: "{{ name }}"
etag: "{{ etag }}"
type: "{{ type }}"
sharingScope: "{{ sharingScope }}"
defaultOutboundAccess: {{ defaultOutboundAccess }}
ipamPoolPrefixAllocations:
- pool:
id: "{{ id }}"
numberOfIpAddresses: "{{ numberOfIpAddresses }}"
allocatedAddressPrefixes: "{{ allocatedAddressPrefixes }}"
serviceGateway:
id: "{{ id }}"
etag: "{{ etag }}"
flowLogs:
- id: "{{ id }}"
name: "{{ name }}"
type: "{{ type }}"
location: "{{ location }}"
tags: "{{ tags }}"
properties:
targetResourceId: "{{ targetResourceId }}"
targetResourceGuid: "{{ targetResourceGuid }}"
storageId: "{{ storageId }}"
enabledFilteringCriteria: "{{ enabledFilteringCriteria }}"
recordTypes: "{{ recordTypes }}"
enabled: {{ enabled }}
retentionPolicy:
days: {{ days }}
enabled: {{ enabled }}
format:
type: "{{ type }}"
version: {{ version }}
flowAnalyticsConfiguration:
networkWatcherFlowAnalyticsConfiguration:
enabled: {{ enabled }}
workspaceId: "{{ workspaceId }}"
workspaceRegion: "{{ workspaceRegion }}"
workspaceResourceId: "{{ workspaceResourceId }}"
trafficAnalyticsInterval: {{ trafficAnalyticsInterval }}
provisioningState: "{{ provisioningState }}"
etag: "{{ etag }}"
identity:
principalId: "{{ principalId }}"
tenantId: "{{ tenantId }}"
type: "{{ type }}"
userAssignedIdentities: "{{ userAssignedIdentities }}"
resourceGuid: "{{ resourceGuid }}"
provisioningState: "{{ provisioningState }}"
UPDATE examples
- update_tags
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
- create_or_update
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
- delete
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
;