你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

SecurityRule 构造函数

定义

重载

SecurityRule()

初始化 SecurityRule 类的新实例。

SecurityRule(String, String, String, String, String, String, String, String, IList<String>, IList<ApplicationSecurityGroup>, String, IList<String>, IList<ApplicationSecurityGroup>, IList<String>, IList<String>, Nullable<Int32>, String, String, String, String)

初始化 SecurityRule 类的新实例。

SecurityRule()

初始化 SecurityRule 类的新实例。

public SecurityRule ();
Public Sub New ()

适用于

SecurityRule(String, String, String, String, String, String, String, String, IList<String>, IList<ApplicationSecurityGroup>, String, IList<String>, IList<ApplicationSecurityGroup>, IList<String>, IList<String>, Nullable<Int32>, String, String, String, String)

初始化 SecurityRule 类的新实例。

public SecurityRule (string protocol, string access, string direction, string id = default, string description = default, string sourcePortRange = default, string destinationPortRange = default, string sourceAddressPrefix = default, System.Collections.Generic.IList<string> sourceAddressPrefixes = default, System.Collections.Generic.IList<Microsoft.Azure.Management.Network.Models.ApplicationSecurityGroup> sourceApplicationSecurityGroups = default, string destinationAddressPrefix = default, System.Collections.Generic.IList<string> destinationAddressPrefixes = default, System.Collections.Generic.IList<Microsoft.Azure.Management.Network.Models.ApplicationSecurityGroup> destinationApplicationSecurityGroups = default, System.Collections.Generic.IList<string> sourcePortRanges = default, System.Collections.Generic.IList<string> destinationPortRanges = default, int? priority = default, string provisioningState = default, string name = default, string etag = default, string type = default);
new Microsoft.Azure.Management.Network.Models.SecurityRule : string * string * string * string * string * string * string * string * System.Collections.Generic.IList<string> * System.Collections.Generic.IList<Microsoft.Azure.Management.Network.Models.ApplicationSecurityGroup> * string * System.Collections.Generic.IList<string> * System.Collections.Generic.IList<Microsoft.Azure.Management.Network.Models.ApplicationSecurityGroup> * System.Collections.Generic.IList<string> * System.Collections.Generic.IList<string> * Nullable<int> * string * string * string * string -> Microsoft.Azure.Management.Network.Models.SecurityRule
Public Sub New (protocol As String, access As String, direction As String, Optional id As String = Nothing, Optional description As String = Nothing, Optional sourcePortRange As String = Nothing, Optional destinationPortRange As String = Nothing, Optional sourceAddressPrefix As String = Nothing, Optional sourceAddressPrefixes As IList(Of String) = Nothing, Optional sourceApplicationSecurityGroups As IList(Of ApplicationSecurityGroup) = Nothing, Optional destinationAddressPrefix As String = Nothing, Optional destinationAddressPrefixes As IList(Of String) = Nothing, Optional destinationApplicationSecurityGroups As IList(Of ApplicationSecurityGroup) = Nothing, Optional sourcePortRanges As IList(Of String) = Nothing, Optional destinationPortRanges As IList(Of String) = Nothing, Optional priority As Nullable(Of Integer) = Nothing, Optional provisioningState As String = Nothing, Optional name As String = Nothing, Optional etag As String = Nothing, Optional type As String = Nothing)

参数

protocol
String

此规则应用到的网络协议。 可能的值包括:“Tcp”、“Udp”、“Icmp”、“Esp”、“*”、“Ah”

access
String

允许或拒绝网络流量。 可能的值包括:“Allow”、“Deny”

direction
String

规则的方向。 direction 指定是要针对传入流量还是传出流量评估该规则。 可能的值包括:“Inbound”、“Outbound”

id
String

资源 ID。

description
String

此规则的说明。 限制为 140 个字符。

sourcePortRange
String

源端口或范围。 介于 0 和 65535 之间的整数或范围。 星号“*”也可用于匹配所有端口。

destinationPortRange
String

目标端口或范围。 介于 0 和 65535 之间的整数或范围。 星号“*”也可用于匹配所有端口。

sourceAddressPrefix
String

CIDR 或源 IP 范围。 也可以使用星号“*”来匹配所有源 IP。 也可以使用默认标记,例如“VirtualNetwork”、“AzureLoadBalancer”和“Internet”。 如果这是入口规则,则指定网络流量的来源。

sourceAddressPrefixes
IList<String>

CIDR 或源 IP 范围。

sourceApplicationSecurityGroups
IList<ApplicationSecurityGroup>

指定为源的应用程序安全组。

destinationAddressPrefix
String

目标地址前缀。 CIDR 或目标 IP 范围。 也可以使用星号“*”来匹配所有源 IP。 也可以使用默认标记,例如“VirtualNetwork”、“AzureLoadBalancer”和“Internet”。

destinationAddressPrefixes
IList<String>

目标地址前缀。 CIDR 或目标 IP 范围。

destinationApplicationSecurityGroups
IList<ApplicationSecurityGroup>

指定为目标的应用程序安全组。

sourcePortRanges
IList<String>

源端口范围。

destinationPortRanges
IList<String>

目标端口范围。

priority
Nullable<Int32>

规则的优先级。 该值可以介于 100 和 4096 之间。 对于集合中的每个规则,优先级编号必须是唯一的。 优先级编号越低,规则优先级越高。

provisioningState
String

安全规则资源的预配状态。 可能的值包括:“Succeeded”、“Updating”、“Deleting”、“Failed”

name
String

资源组中唯一的资源的名称。 此名称可用于访问资源。

etag
String

一个唯一的只读字符串,每当资源更新时都会更改。

type
String

资源类型。

适用于