Share via


ComputeBatchModelFactory.NetworkSecurityGroupRule Method

Definition

A network security group rule to apply to an inbound endpoint.

public static Azure.Compute.Batch.NetworkSecurityGroupRule NetworkSecurityGroupRule(int priority = 0, Azure.Compute.Batch.NetworkSecurityGroupRuleAccess access = default, string sourceAddressPrefix = default, System.Collections.Generic.IEnumerable<string> sourcePortRanges = default);
static member NetworkSecurityGroupRule : int * Azure.Compute.Batch.NetworkSecurityGroupRuleAccess * string * seq<string> -> Azure.Compute.Batch.NetworkSecurityGroupRule
Public Shared Function NetworkSecurityGroupRule (Optional priority As Integer = 0, Optional access As NetworkSecurityGroupRuleAccess = Nothing, Optional sourceAddressPrefix As String = Nothing, Optional sourcePortRanges As IEnumerable(Of String) = Nothing) As NetworkSecurityGroupRule

Parameters

priority
Int32

The priority for this rule. Priorities within a Pool must be unique and are evaluated in order of priority. The lower the number the higher the priority. For example, rules could be specified with order numbers of 150, 250, and 350. The rule with the order number of 150 takes precedence over the rule that has an order of 250. Allowed priorities are 150 to 4096. If any reserved or duplicate values are provided the request fails with HTTP status code 400.

access
NetworkSecurityGroupRuleAccess

The action that should be taken for a specified IP address, subnet range or tag.

sourceAddressPrefix
String

The source address prefix or tag to match for the rule. Valid values are a single IP address (i.e. 10.10.10.10), IP subnet (i.e. 192.168.1.0/24), default tag, or * (for all addresses). If any other values are provided the request fails with HTTP status code 400.

sourcePortRanges
IEnumerable<String>

The source port ranges to match for the rule. Valid values are '' (for all ports 0 - 65535), a specific port (i.e. 22), or a port range (i.e. 100-200). The ports must be in the range of 0 to 65535. Each entry in this collection must not overlap any other entry (either a range or an individual port). If any other values are provided the request fails with HTTP status code 400. The default value is ''.

Returns

A new NetworkSecurityGroupRule instance for mocking.

Applies to