Microsoft.AzureStackHCI networkSecurityGroups/securityRules 2026-04-01-preview

Bicep resource definition

The networkSecurityGroups/securityRules resource type can be deployed with operations that target:

For a list of changed properties in each API version, see change log.

Resource format

To create a Microsoft.AzureStackHCI/networkSecurityGroups/securityRules resource, add the following Bicep to your template.

resource symbolicname 'Microsoft.AzureStackHCI/networkSecurityGroups/securityRules@2026-04-01-preview' = {
  parent: resourceSymbolicName
  extendedLocation: {
    name: 'string'
    type: 'string'
  }
  name: 'string'
  properties: {
    access: 'string'
    description: 'string'
    destinationAddressPrefixes: [
      'string'
    ]
    destinationPortRanges: [
      'string'
    ]
    direction: 'string'
    priority: int
    protocol: 'string'
    sourceAddressPrefixes: [
      'string'
    ]
    sourcePortRanges: [
      'string'
    ]
  }
}

Property Values

Microsoft.AzureStackHCI/networkSecurityGroups/securityRules

Name Description Value
extendedLocation The extendedLocation of the resource. ExtendedLocation
name The resource name string

Constraints:
Pattern = ^[a-zA-Z0-9]$|^[a-zA-Z0-9][-._a-zA-Z0-9]{0,62}[a-zA-Z0-9]$ (required)
parent In Bicep, you can specify the parent resource for a child resource. You only need to add this property when the child resource is declared outside of the parent resource.

For more information, see Child resource outside parent resource.
Symbolic name for resource of type: networkSecurityGroups
properties The resource-specific properties for this resource. SecurityRuleProperties

ExtendedLocation

Name Description Value
name The name of the extended location. string
type The type of the extended location. 'CustomLocation'

SecurityRuleProperties

Name Description Value
access The network traffic is allowed or denied. 'Allow'
'Deny' (required)
description A description for this rule. Restricted to 140 chars. string
destinationAddressPrefixes The destination address prefixes. CIDR or destination IP ranges. string[]
destinationPortRanges The destination port ranges. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports. string[]
direction The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. 'Inbound'
'Outbound' (required)
priority The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule. int (required)
protocol Network protocol this rule applies to. '*'
'Icmp'
'Tcp'
'Udp' (required)
sourceAddressPrefixes The CIDR or source IP ranges. string[]
sourcePortRanges The source port ranges. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports. string[]

ARM template resource definition

The networkSecurityGroups/securityRules resource type can be deployed with operations that target:

Usage Examples

Resource format

To create a Microsoft.AzureStackHCI/networkSecurityGroups/securityRules resource, add the following JSON to your template.

{
  "type": "Microsoft.AzureStackHCI/networkSecurityGroups/securityRules",
  "apiVersion": "2026-04-01-preview",
  "name": "string",
  "extendedLocation": {
    "name": "string",
    "type": "string"
  },
  "properties": {
    "access": "string",
    "description": "string",
    "destinationAddressPrefixes": [ "string" ],
    "destinationPortRanges": [ "string" ],
    "direction": "string",
    "priority": "int",
    "protocol": "string",
    "sourceAddressPrefixes": [ "string" ],
    "sourcePortRanges": [ "string" ]
  }
}

Property Values

Microsoft.AzureStackHCI/networkSecurityGroups/securityRules

Name Description Value
apiVersion The api version '2026-04-01-preview'
extendedLocation The extendedLocation of the resource. ExtendedLocation
name The resource name string

Constraints:
Pattern = ^[a-zA-Z0-9]$|^[a-zA-Z0-9][-._a-zA-Z0-9]{0,62}[a-zA-Z0-9]$ (required)
properties The resource-specific properties for this resource. SecurityRuleProperties
type The resource type 'Microsoft.AzureStackHCI/networkSecurityGroups/securityRules'

ExtendedLocation

Name Description Value
name The name of the extended location. string
type The type of the extended location. 'CustomLocation'

SecurityRuleProperties

Name Description Value
access The network traffic is allowed or denied. 'Allow'
'Deny' (required)
description A description for this rule. Restricted to 140 chars. string
destinationAddressPrefixes The destination address prefixes. CIDR or destination IP ranges. string[]
destinationPortRanges The destination port ranges. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports. string[]
direction The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. 'Inbound'
'Outbound' (required)
priority The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule. int (required)
protocol Network protocol this rule applies to. '*'
'Icmp'
'Tcp'
'Udp' (required)
sourceAddressPrefixes The CIDR or source IP ranges. string[]
sourcePortRanges The source port ranges. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports. string[]

Terraform (AzAPI provider) resource definition

The networkSecurityGroups/securityRules resource type can be deployed with operations that target:

  • Resource groups For a list of changed properties in each API version, see change log.

Resource format

To create a Microsoft.AzureStackHCI/networkSecurityGroups/securityRules resource, add the following Terraform to your template.

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.AzureStackHCI/networkSecurityGroups/securityRules@2026-04-01-preview"
  name = "string"
  parent_id = "string"
  body = {
    extendedLocation = {
      name = "string"
      type = "string"
    }
    properties = {
      access = "string"
      description = "string"
      destinationAddressPrefixes = [
        "string"
      ]
      destinationPortRanges = [
        "string"
      ]
      direction = "string"
      priority = int
      protocol = "string"
      sourceAddressPrefixes = [
        "string"
      ]
      sourcePortRanges = [
        "string"
      ]
    }
  }
}

Property Values

Microsoft.AzureStackHCI/networkSecurityGroups/securityRules

Name Description Value
extendedLocation The extendedLocation of the resource. ExtendedLocation
name The resource name string

Constraints:
Pattern = ^[a-zA-Z0-9]$|^[a-zA-Z0-9][-._a-zA-Z0-9]{0,62}[a-zA-Z0-9]$ (required)
parent_id The ID of the resource that is the parent for this resource. ID for resource of type: networkSecurityGroups
properties The resource-specific properties for this resource. SecurityRuleProperties
type The resource type "Microsoft.AzureStackHCI/networkSecurityGroups/securityRules@2026-04-01-preview"

ExtendedLocation

Name Description Value
name The name of the extended location. string
type The type of the extended location. 'CustomLocation'

SecurityRuleProperties

Name Description Value
access The network traffic is allowed or denied. 'Allow'
'Deny' (required)
description A description for this rule. Restricted to 140 chars. string
destinationAddressPrefixes The destination address prefixes. CIDR or destination IP ranges. string[]
destinationPortRanges The destination port ranges. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports. string[]
direction The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. 'Inbound'
'Outbound' (required)
priority The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule. int (required)
protocol Network protocol this rule applies to. '*'
'Icmp'
'Tcp'
'Udp' (required)
sourceAddressPrefixes The CIDR or source IP ranges. string[]
sourcePortRanges The source port ranges. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports. string[]