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

Microsoft.Network virtualNetworks

Bicep 资源定义

virtualNetworks 资源类型可以通过针对以下操作进行部署:

有关每个 API 版本中更改的属性的列表,请参阅 更改日志

注解

有关创建虚拟网络和子网的指南,请参阅 使用 Bicep 创建虚拟网络资源

资源格式

若要创建 Microsoft.Network/virtualNetworks 资源,请将以下 Bicep 添加到模板。

resource symbolicname 'Microsoft.Network/virtualNetworks@2023-04-01' = {
  name: 'string'
  location: 'string'
  tags: {
    tagName1: 'tagValue1'
    tagName2: 'tagValue2'
  }
  extendedLocation: {
    name: 'string'
    type: 'EdgeZone'
  }
  properties: {
    addressSpace: {
      addressPrefixes: [
        'string'
      ]
    }
    bgpCommunities: {
      virtualNetworkCommunity: 'string'
    }
    ddosProtectionPlan: {
      id: 'string'
    }
    dhcpOptions: {
      dnsServers: [
        'string'
      ]
    }
    enableDdosProtection: bool
    enableVmProtection: bool
    encryption: {
      enabled: bool
      enforcement: 'string'
    }
    flowTimeoutInMinutes: int
    ipAllocations: [
      {
        id: 'string'
      }
    ]
    subnets: [
      {
        id: 'string'
        name: 'string'
        properties: {
          addressPrefix: 'string'
          addressPrefixes: [
            'string'
          ]
          applicationGatewayIPConfigurations: [
            {
              id: 'string'
              name: 'string'
              properties: {
                subnet: {
                  id: 'string'
                }
              }
            }
          ]
          delegations: [
            {
              id: 'string'
              name: 'string'
              properties: {
                serviceName: 'string'
              }
              type: 'string'
            }
          ]
          ipAllocations: [
            {
              id: 'string'
            }
          ]
          natGateway: {
            id: 'string'
          }
          networkSecurityGroup: {
            id: 'string'
            location: 'string'
            properties: {
              flushConnection: bool
              securityRules: [
                {
                  id: 'string'
                  name: 'string'
                  properties: {
                    access: 'string'
                    description: 'string'
                    destinationAddressPrefix: 'string'
                    destinationAddressPrefixes: [
                      'string'
                    ]
                    destinationApplicationSecurityGroups: [
                      {
                        id: 'string'
                        location: 'string'
                        properties: {}
                        tags: {}
                      }
                    ]
                    destinationPortRange: 'string'
                    destinationPortRanges: [
                      'string'
                    ]
                    direction: 'string'
                    priority: int
                    protocol: 'string'
                    sourceAddressPrefix: 'string'
                    sourceAddressPrefixes: [
                      'string'
                    ]
                    sourceApplicationSecurityGroups: [
                      {
                        id: 'string'
                        location: 'string'
                        properties: {}
                        tags: {}
                      }
                    ]
                    sourcePortRange: 'string'
                    sourcePortRanges: [
                      'string'
                    ]
                  }
                  type: 'string'
                }
              ]
            }
            tags: {}
          }
          privateEndpointNetworkPolicies: 'string'
          privateLinkServiceNetworkPolicies: 'string'
          routeTable: {
            id: 'string'
            location: 'string'
            properties: {
              disableBgpRoutePropagation: bool
              routes: [
                {
                  id: 'string'
                  name: 'string'
                  properties: {
                    addressPrefix: 'string'
                    hasBgpOverride: bool
                    nextHopIpAddress: 'string'
                    nextHopType: 'string'
                  }
                  type: 'string'
                }
              ]
            }
            tags: {}
          }
          serviceEndpointPolicies: [
            {
              id: 'string'
              location: 'string'
              properties: {
                contextualServiceEndpointPolicies: [
                  'string'
                ]
                serviceAlias: 'string'
                serviceEndpointPolicyDefinitions: [
                  {
                    id: 'string'
                    name: 'string'
                    properties: {
                      description: 'string'
                      service: 'string'
                      serviceResources: [
                        'string'
                      ]
                    }
                    type: 'string'
                  }
                ]
              }
              tags: {}
            }
          ]
          serviceEndpoints: [
            {
              locations: [
                'string'
              ]
              service: 'string'
            }
          ]
        }
        type: 'string'
      }
    ]
    virtualNetworkPeerings: [
      {
        id: 'string'
        name: 'string'
        properties: {
          allowForwardedTraffic: bool
          allowGatewayTransit: bool
          allowVirtualNetworkAccess: bool
          doNotVerifyRemoteGateways: bool
          peeringState: 'string'
          peeringSyncLevel: 'string'
          remoteAddressSpace: {
            addressPrefixes: [
              'string'
            ]
          }
          remoteBgpCommunities: {
            virtualNetworkCommunity: 'string'
          }
          remoteVirtualNetwork: {
            id: 'string'
          }
          remoteVirtualNetworkAddressSpace: {
            addressPrefixes: [
              'string'
            ]
          }
          useRemoteGateways: bool
        }
        type: 'string'
      }
    ]
  }
}

属性值

virtualNetworks

名称 说明
name 资源名称 字符串 (必需)

字符限制:2-64

有效字符:
字母数字、下划线字符、句点和连字符。

以字母数字开头。 以字母数字或下划线结尾。
location 资源位置。 字符串
标记 资源标记。 标记名称和值的字典。 请参阅 模板中的标记
extendedLocation 虚拟网络的扩展位置。 ExtendedLocation
properties 虚拟网络的属性。 VirtualNetworkPropertiesFormat

ExtendedLocation

名称 说明
name 扩展位置的名称。 字符串
type 扩展位置的类型。 “EdgeZone”

VirtualNetworkPropertiesFormat

名称 说明
addressSpace AddressSpace,其中包含子网可以使用的 IP 地址范围数组。 AddressSpace
bgp 社区 通过 ExpressRoute 发送的 Bgp 社区,每个路由与此 VNET 中的前缀对应。 VirtualNetworkBgp 社区
ddosProtectionPlan 与虚拟网络关联的 DDoS 保护计划。 SubResource
dhcpOptions dhcpOptions,其中包含可用于虚拟网络中部署的 VM 的 DNS 服务器数组。 DhcpOptions
enableDdosProtection 指示是否为虚拟网络中的所有受保护资源启用 DDoS 保护。 它需要与资源关联的 DDoS 保护计划。 bool
enableVmProtection 指示是否为虚拟网络中的所有子网启用了 VM 保护。 bool
加密 指示是否在虚拟网络上启用了加密,以及是否在加密的 VNet 中允许不使用加密的 VM。 VirtualNetworkEncryption
flowTimeoutInMinutes 虚拟网络的 FlowTimeout 值 (以分钟为单位) int
ipAllocations 引用此 VNET 的 IpAllocation 数组。 SubResource[]
subnets 虚拟网络中的子网列表。 Subnet[]
virtualNetworkPeerings 虚拟网络中的对等互连列表。 VirtualNetworkPeering[]

AddressSpace

名称 说明
addressPrefixes 以 CIDR 表示法为此虚拟网络保留的地址块列表。 string[]

VirtualNetworkBgp 社区

名称 说明
virtualNetworkCommunity 与虚拟网络关联的 BGP 社区。 字符串 (必需)

SubResource

名称 说明 Value
id 资源 ID。 字符串

DhcpOptions

名称 说明
dnsServers DNS 服务器 IP 地址的列表。 string[]

VirtualNetworkEncryption

名称 说明
enabled 指示是否在虚拟网络上启用了加密。 bool (必需)
执法 如果加密的 VNet 允许不支持加密的 VM “AllowUnencrypted”
“DropUnencrypted”

子网

名称 说明 Value
id 资源 ID。 字符串
name 资源组中唯一的资源的名称。 此名称可用于访问资源。 string
properties 子网的属性。 SubnetPropertiesFormat
类型 资源类型。 字符串

SubnetPropertiesFormat

名称 说明
addressPrefix 子网的地址前缀。 字符串
addressPrefixes 子网的地址前缀列表。 string[]
applicationGatewayIPConfigurations 虚拟网络资源的应用程序网关 IP 配置。 ApplicationGatewayIPConfiguration[]
代表团 对子网上的委派的引用数组。 委派[]
ipAllocations 引用此子网的 IpAllocation 数组。 SubResource[]
natGateway 与此子网关联的 Nat 网关。 SubResource
networkSecurityGroup 对 NetworkSecurityGroup 资源的引用。 NetworkSecurityGroup
privateEndpointNetworkPolicies 在子网的专用终结点上启用或禁用应用网络策略。 “Disabled”
“已启用”
privateLinkServiceNetworkPolicies 启用或禁用对子网中的专用链接服务应用网络策略。 “Disabled”
“已启用”
routeTable 对 RouteTable 资源的引用。 RouteTable
serviceEndpointPolicies 服务终结点策略的数组。 ServiceEndpointPolicy[]
serviceEndpoints 服务终结点的数组。 ServiceEndpointPropertiesFormat[]

ApplicationGatewayIPConfiguration

名称 说明 Value
id 资源 ID。 字符串
name 应用程序网关中唯一的 IP 配置的名称。 string
properties 应用程序网关 IP 配置的属性。 ApplicationGatewayIPConfigurationPropertiesFormat

ApplicationGatewayIPConfigurationPropertiesFormat

名称 说明
子网 对子网资源的引用。 应用程序网关从中获取其专用地址的子网。 SubResource

委托

名称 说明 Value
id 资源 ID。 字符串
name 子网中唯一的资源的名称。 此名称可用于访问资源。 string
properties 子网的属性。 ServiceDelegationPropertiesFormat
类型 资源类型。 字符串

ServiceDelegationPropertiesFormat

名称 说明
serviceName 子网应委托给的服务的名称, (例如 Microsoft.Sql/servers) 。 字符串

NetworkSecurityGroup

名称 说明 Value
id 资源 ID。 字符串
location 资源位置。 string
properties 网络安全组的属性。 NetworkSecurityGroupPropertiesFormat
标记 资源标记。 object

NetworkSecurityGroupPropertiesFormat

名称 说明
flushConnection 启用后,将在规则更新时重新评估从网络安全组连接创建的流。 初始启用将触发重新评估。 bool
securityRules 网络安全组的安全规则集合。 SecurityRule[]

SecurityRule

名称 说明 Value
id 资源 ID。 字符串
name 资源组中唯一的资源的名称。 此名称可用于访问资源。 string
properties 安全规则的属性。 SecurityRulePropertiesFormat
类型 资源类型。 字符串

SecurityRulePropertiesFormat

名称 说明
access 允许或拒绝网络流量。 “允许”
“拒绝” (必需)
description 此规则的说明。 限制为 140 个字符。 字符串
destinationAddressPrefix 目标地址前缀。 CIDR 或目标 IP 范围。 也可以使用星号“*”来匹配所有源 IP。 也可以使用默认标记,例如“VirtualNetwork”、“AzureLoadBalancer”和“Internet”。 字符串
destinationAddressPrefixes 目标地址前缀。 CIDR 或目标 IP 范围。 string[]
destinationApplicationSecurityGroups 指定为目标的应用程序安全组。 ApplicationSecurityGroup[]
destinationPortRange 目标端口或范围。 介于 0 和 65535 之间的整数或范围。 星号“*”也可用于匹配所有端口。 字符串
destinationPortRanges 目标端口范围。 string[]
direction 规则的方向。 direction 指定是要针对传入流量还是传出流量评估该规则。 'Inbound'
需要“出站” ()
priority 规则的优先级。 该值可以介于 100 和 4096 之间。 对于集合中的每个规则,优先级编号必须是唯一的。 优先级编号越低,规则优先级越高。 int (必需)
protocol 此规则应用到的网络协议。 '*'
'Ah'
'Esp'
'Icmp'
'Tcp'
“Udp” (必需)
sourceAddressPrefix CIDR 或源 IP 范围。 也可以使用星号“*”来匹配所有源 IP。 也可以使用默认标记,例如“VirtualNetwork”、“AzureLoadBalancer”和“Internet”。 如果这是入口规则,则指定网络流量的来源。 字符串
sourceAddressPrefixes CIDR 或源 IP 范围。 string[]
sourceApplicationSecurityGroups 指定为源的应用程序安全组。 ApplicationSecurityGroup[]
sourcePortRange 源端口或范围。 介于 0 和 65535 之间的整数或范围。 星号“*”也可用于匹配所有端口。 字符串
sourcePortRanges 源端口范围。 string[]

ApplicationSecurityGroup

名称 说明 Value
id 资源 ID。 字符串
location 资源位置。 string
properties 应用程序安全组的属性。 ApplicationSecurityGroupPropertiesFormat
标记 资源标记。 object

ApplicationSecurityGroupPropertiesFormat

此对象不包含部署期间要设置的任何属性。 所有属性均为 ReadOnly。

RouteTable

名称 说明 Value
id 资源 ID。 字符串
location 资源位置。 string
properties 路由表的属性。 RouteTablePropertiesFormat
标记 资源标记。 object

RouteTablePropertiesFormat

名称 说明
disableBgpRoutePropagation 是否禁用 BGP 在该路由表上获知的路由。 True 表示禁用。 bool
routes 路由表中包含的路由的集合。 Route[]

路由

名称 说明 Value
id 资源 ID。 字符串
name 资源组中唯一的资源的名称。 此名称可用于访问资源。 string
properties 路由的属性。 RoutePropertiesFormat
类型 资源类型。 字符串

RoutePropertiesFormat

名称 说明
addressPrefix 路由应用到的目标 CIDR。 字符串
hasBgpOverride 一个 值,该值指示此路由是否替代重叠的 BGP 路由,而不考虑 LPM。 bool
nextHopIpAddress IP 地址数据包应转发到。 下一跃点值仅在下一跃点类型为 VirtualAppliance 的路由中被允许。 字符串
nextHopType 数据包应发送到的 Azure 跃点的类型。 “Internet”
“None”
“VirtualAppliance”
“VirtualNetworkGateway”
需要“VnetLocal” ()

ServiceEndpointPolicy

名称 说明 Value
id 资源 ID。 字符串
location 资源位置。 string
properties 服务终结点策略的属性。 ServiceEndpointPolicyPropertiesFormat
标记 资源标记。 object

ServiceEndpointPolicyPropertiesFormat

名称 说明
contextualServiceEndpointPolicies 上下文服务终结点策略的集合。 string[]
serviceAlias 指示策略是否属于某个服务的别名 字符串
serviceEndpointPolicyDefinitions 服务终结点策略的服务终结点策略定义的集合。 ServiceEndpointPolicyDefinition[]

ServiceEndpointPolicyDefinition

名称 说明 Value
id 资源 ID。 字符串
name 资源组中唯一的资源的名称。 此名称可用于访问资源。 string
properties 服务终结点策略定义的属性。 ServiceEndpointPolicyDefinitionPropertiesFormat
类型 资源类型。 字符串

ServiceEndpointPolicyDefinitionPropertiesFormat

名称 说明
description 此规则的说明。 限制为 140 个字符。 字符串
服务 服务终结点名称。 字符串
serviceResources 服务资源的列表。 string[]

ServiceEndpointPropertiesFormat

名称 说明
locations 位置列表。 string[]
服务 终结点服务的类型。 字符串

VirtualNetworkPeering

名称 说明 Value
id 资源 ID。 字符串
name 资源组中唯一的资源的名称。 此名称可用于访问资源。 string
properties 虚拟网络对等互连的属性。 VirtualNetworkPeeringPropertiesFormat
类型 资源类型。 字符串

VirtualNetworkPeeringPropertiesFormat

名称 说明
allowForwardedTraffic 远程虚拟网络中是否允许/禁止来自本地虚拟网络中 VM 的转发流量。 bool
allowGatewayTransit 是否可以在远程虚拟网络中使用网关链接来链接到此虚拟网络。 bool
allowVirtualNetworkAccess 本地虚拟网络空间中的 VM 能否访问远程虚拟网络空间中的 VM。 bool
doNotVerifyRemoteGateways 如果需要验证远程网关的预配状态。 bool
peeringState 虚拟网络对等互连的状态。 “Connected”
“Disconnected”
'Initiated'
peeringSyncLevel 虚拟网络对等互连的对等互连同步状态。 “FullyInSync”
'LocalAndRemoteNotInSync'
'LocalNotInSync'
“RemoteNotInSync”
remoteAddressSpace 对与远程虚拟网络对等互连的地址空间的引用。 AddressSpace
remoteBgpCommunities 对远程虚拟网络的 Bgp 社区的引用。 VirtualNetworkBgpCommunities
remoteVirtualNetwork 对远程虚拟网络的引用。 远程虚拟网络可以位于相同或不同的区域中, (预览版) 。 请参阅此处注册预览版,并详细了解 /azure/virtual-network/virtual-network-create-peering) (。 SubResource
remoteVirtualNetworkAddressSpace 对远程虚拟网络的当前地址空间的引用。 AddressSpace
useRemoteGateways 如果远程网关可以在此虚拟网络上使用。 如果该标志设置为 true,并且远程对等互连上的 allowGatewayTransit 也为 true,则虚拟网络将使用远程虚拟网络的网关进行传输。 只有一个对等互连可以将此标志设置为 true。 如果虚拟网络已有网关,则无法设置此标志。 bool

快速入门模板

以下快速入门模板部署此资源类型。

模板 说明
201-vnet-2subnets-service-endpoints-storage-integration

部署到 Azure
在同一 VNet 中的两个不同子网中创建 2 个具有 NIC 的新 VM。 在其中一个子网上设置服务终结点,并将存储帐户保护到该子网。
具有诊断日志的虚拟网络

部署到 Azure
此模板创建包含诊断日志的虚拟网络,并允许将可选功能添加到每个子网
跨两个区域创建 VNET 到 VNET 连接

部署到 Azure
此模板允许使用 虚拟网络 网关连接不同区域中的两个 VNET
创建 BGP VNET 到 VNET 连接

部署到 Azure
此模板允许使用 虚拟网络 网关和 BGP 连接两个 VNET
使用 vNet 对等互连创建 vNet 到 vNet 连接

部署到 Azure
此模板允许使用 vNet 对等互连连接两个 vNet
创建三个 vNet 来演示可传递 BGP 连接

部署到 Azure
此模板部署使用虚拟网络网关和已启用 BGP 的连接连接的三个 vNet
创建包含两个子网的虚拟网络

部署到 Azure
此模板允许创建包含两个子网的虚拟网络。

ARM 模板资源定义

可以使用面向以下操作部署 virtualNetworks 资源类型:

有关每个 API 版本中已更改属性的列表,请参阅 更改日志

注解

有关创建虚拟网络和子网的指导,请参阅 使用 Bicep 创建虚拟网络资源

资源格式

若要创建 Microsoft.Network/virtualNetworks 资源,请将以下 JSON 添加到模板。

{
  "type": "Microsoft.Network/virtualNetworks",
  "apiVersion": "2023-04-01",
  "name": "string",
  "location": "string",
  "tags": {
    "tagName1": "tagValue1",
    "tagName2": "tagValue2"
  },
  "extendedLocation": {
    "name": "string",
    "type": "EdgeZone"
  },
  "properties": {
    "addressSpace": {
      "addressPrefixes": [ "string" ]
    },
    "bgpCommunities": {
      "virtualNetworkCommunity": "string"
    },
    "ddosProtectionPlan": {
      "id": "string"
    },
    "dhcpOptions": {
      "dnsServers": [ "string" ]
    },
    "enableDdosProtection": "bool",
    "enableVmProtection": "bool",
    "encryption": {
      "enabled": "bool",
      "enforcement": "string"
    },
    "flowTimeoutInMinutes": "int",
    "ipAllocations": [
      {
        "id": "string"
      }
    ],
    "subnets": [
      {
        "id": "string",
        "name": "string",
        "properties": {
          "addressPrefix": "string",
          "addressPrefixes": [ "string" ],
          "applicationGatewayIPConfigurations": [
            {
              "id": "string",
              "name": "string",
              "properties": {
                "subnet": {
                  "id": "string"
                }
              }
            }
          ],
          "delegations": [
            {
              "id": "string",
              "name": "string",
              "properties": {
                "serviceName": "string"
              },
              "type": "string"
            }
          ],
          "ipAllocations": [
            {
              "id": "string"
            }
          ],
          "natGateway": {
            "id": "string"
          },
          "networkSecurityGroup": {
            "id": "string",
            "location": "string",
            "properties": {
              "flushConnection": "bool",
              "securityRules": [
                {
                  "id": "string",
                  "name": "string",
                  "properties": {
                    "access": "string",
                    "description": "string",
                    "destinationAddressPrefix": "string",
                    "destinationAddressPrefixes": [ "string" ],
                    "destinationApplicationSecurityGroups": [
                      {
                        "id": "string",
                        "location": "string",
                        "properties": {},
                        "tags": {}
                      }
                    ],
                    "destinationPortRange": "string",
                    "destinationPortRanges": [ "string" ],
                    "direction": "string",
                    "priority": "int",
                    "protocol": "string",
                    "sourceAddressPrefix": "string",
                    "sourceAddressPrefixes": [ "string" ],
                    "sourceApplicationSecurityGroups": [
                      {
                        "id": "string",
                        "location": "string",
                        "properties": {},
                        "tags": {}
                      }
                    ],
                    "sourcePortRange": "string",
                    "sourcePortRanges": [ "string" ]
                  },
                  "type": "string"
                }
              ]
            },
            "tags": {}
          },
          "privateEndpointNetworkPolicies": "string",
          "privateLinkServiceNetworkPolicies": "string",
          "routeTable": {
            "id": "string",
            "location": "string",
            "properties": {
              "disableBgpRoutePropagation": "bool",
              "routes": [
                {
                  "id": "string",
                  "name": "string",
                  "properties": {
                    "addressPrefix": "string",
                    "hasBgpOverride": "bool",
                    "nextHopIpAddress": "string",
                    "nextHopType": "string"
                  },
                  "type": "string"
                }
              ]
            },
            "tags": {}
          },
          "serviceEndpointPolicies": [
            {
              "id": "string",
              "location": "string",
              "properties": {
                "contextualServiceEndpointPolicies": [ "string" ],
                "serviceAlias": "string",
                "serviceEndpointPolicyDefinitions": [
                  {
                    "id": "string",
                    "name": "string",
                    "properties": {
                      "description": "string",
                      "service": "string",
                      "serviceResources": [ "string" ]
                    },
                    "type": "string"
                  }
                ]
              },
              "tags": {}
            }
          ],
          "serviceEndpoints": [
            {
              "locations": [ "string" ],
              "service": "string"
            }
          ]
        },
        "type": "string"
      }
    ],
    "virtualNetworkPeerings": [
      {
        "id": "string",
        "name": "string",
        "properties": {
          "allowForwardedTraffic": "bool",
          "allowGatewayTransit": "bool",
          "allowVirtualNetworkAccess": "bool",
          "doNotVerifyRemoteGateways": "bool",
          "peeringState": "string",
          "peeringSyncLevel": "string",
          "remoteAddressSpace": {
            "addressPrefixes": [ "string" ]
          },
          "remoteBgpCommunities": {
            "virtualNetworkCommunity": "string"
          },
          "remoteVirtualNetwork": {
            "id": "string"
          },
          "remoteVirtualNetworkAddressSpace": {
            "addressPrefixes": [ "string" ]
          },
          "useRemoteGateways": "bool"
        },
        "type": "string"
      }
    ]
  }
}

属性值

virtualNetworks

名称 说明 Value
type 资源类型 “Microsoft.Network/virtualNetworks”
apiVersion 资源 API 版本 '2023-04-01'
name 资源名称 字符串 (必需)

字符限制:2-64

有效字符:
字母数字、下划线字符、句点和连字符。

以字母数字开头。 以字母数字或下划线结尾。
location 资源位置。 字符串
标记 资源标记。 标记名称和值的字典。 请参阅 模板中的标记
extendedLocation 虚拟网络的扩展位置。 ExtendedLocation
properties 虚拟网络的属性。 VirtualNetworkPropertiesFormat

ExtendedLocation

名称 说明
name 扩展位置的名称。 字符串
type 扩展位置的类型。 “EdgeZone”

VirtualNetworkPropertiesFormat

名称 说明
addressSpace AddressSpace,其中包含子网可以使用的 IP 地址范围数组。 AddressSpace
bgp 社区 通过 ExpressRoute 发送的 Bgp 社区,每个路由对应于此 VNET 中的前缀。 VirtualNetworkBgpCommunities
ddosProtectionPlan 与虚拟网络关联的 DDoS 保护计划。 SubResource
dhcpOptions dhcpOptions,其中包含可用于虚拟网络中部署的 VM 的 DNS 服务器数组。 DhcpOptions
enableDdosProtection 指示是否为虚拟网络中的所有受保护资源启用了 DDoS 保护。 它需要与资源关联的 DDoS 保护计划。 bool
enableVmProtection 指示是否为虚拟网络中的所有子网启用了 VM 保护。 bool
加密 指示是否在虚拟网络上启用了加密,以及是否允许在加密的 VNet 中启用不加密的 VM。 VirtualNetworkEncryption
flowTimeoutInMinutes 虚拟网络的 FlowTimeout 值以分钟) ( int
ipAllocations 引用此 VNET 的 IpAllocation 数组。 SubResource[]
subnets 虚拟网络中的子网列表。 Subnet[]
virtualNetworkPeerings 虚拟网络中的对等互连列表。 VirtualNetworkPeering[]

AddressSpace

名称 说明
addressPrefixes 以 CIDR 表示法为此虚拟网络保留的地址块列表。 string[]

VirtualNetworkBgpCommunities

名称 说明
virtualNetworkCommunity 与虚拟网络关联的 BGP 社区。 字符串 (必需)

SubResource

名称 说明 Value
id 资源 ID。 字符串

DhcpOptions

名称 说明
dnsServers DNS 服务器 IP 地址的列表。 string[]

VirtualNetworkEncryption

名称 说明
enabled 指示是否在虚拟网络上启用了加密。 bool (必需)
执法 如果加密的 VNet 允许不支持加密的 VM “AllowUnencrypted”
“DropUnencrypted”

子网

名称 说明 Value
id 资源 ID。 字符串
name 资源组中唯一的资源的名称。 此名称可用于访问资源。 string
properties 子网的属性。 SubnetPropertiesFormat
类型 资源类型。 字符串

SubnetPropertiesFormat

名称 说明
addressPrefix 子网的地址前缀。 字符串
addressPrefixes 子网的地址前缀列表。 string[]
applicationGatewayIPConfigurations 虚拟网络资源的应用程序网关 IP 配置。 ApplicationGatewayIPConfiguration[]
代表团 对子网上的委派的引用数组。 委派[]
ipAllocations 引用此子网的 IpAllocation 数组。 SubResource[]
natGateway 与此子网关联的 Nat 网关。 SubResource
networkSecurityGroup 对 NetworkSecurityGroup 资源的引用。 NetworkSecurityGroup
privateEndpointNetworkPolicies 在子网的专用终结点上启用或禁用应用网络策略。 “Disabled”
“已启用”
privateLinkServiceNetworkPolicies 启用或禁用对子网中的专用链接服务应用网络策略。 “Disabled”
“已启用”
routeTable 对 RouteTable 资源的引用。 RouteTable
serviceEndpointPolicies 服务终结点策略的数组。 ServiceEndpointPolicy[]
serviceEndpoints 服务终结点的数组。 ServiceEndpointPropertiesFormat[]

ApplicationGatewayIPConfiguration

名称 说明 Value
id 资源 ID。 字符串
name 应用程序网关中唯一的 IP 配置的名称。 string
properties 应用程序网关 IP 配置的属性。 ApplicationGatewayIPConfigurationPropertiesFormat

ApplicationGatewayIPConfigurationPropertiesFormat

名称 说明
子网 对子网资源的引用。 应用程序网关从中获取其专用地址的子网。 SubResource

委托

名称 说明 Value
id 资源 ID。 字符串
name 子网中唯一的资源的名称。 此名称可用于访问资源。 string
properties 子网的属性。 ServiceDelegationPropertiesFormat
类型 资源类型。 字符串

ServiceDelegationPropertiesFormat

名称 说明
serviceName 子网应委托给的服务的名称, (例如 Microsoft.Sql/servers) 。 字符串

NetworkSecurityGroup

名称 说明 Value
id 资源 ID。 字符串
location 资源位置。 string
properties 网络安全组的属性。 NetworkSecurityGroupPropertiesFormat
标记 资源标记。 object

NetworkSecurityGroupPropertiesFormat

名称 说明
flushConnection 启用后,当规则更新时,将从网络安全组连接创建的流重新评估。 初始启用将触发重新评估。 bool
securityRules 网络安全组的安全规则的集合。 SecurityRule[]

SecurityRule

名称 说明 Value
id 资源 ID。 字符串
name 资源组中唯一的资源的名称。 此名称可用于访问资源。 string
properties 安全规则的属性。 SecurityRulePropertiesFormat
类型 资源类型。 字符串

SecurityRulePropertiesFormat

名称 说明
access 允许或拒绝网络流量。 “允许”
需要“拒绝” ()
description 此规则的说明。 限制为 140 个字符。 字符串
destinationAddressPrefix 目标地址前缀。 CIDR 或目标 IP 范围。 也可以使用星号“*”来匹配所有源 IP。 也可以使用默认标记,例如“VirtualNetwork”、“AzureLoadBalancer”和“Internet”。 字符串
destinationAddressPrefixes 目标地址前缀。 CIDR 或目标 IP 范围。 string[]
destinationApplicationSecurityGroups 指定为目标的应用程序安全组。 ApplicationSecurityGroup[]
destinationPortRange 目标端口或范围。 介于 0 和 65535 之间的整数或范围。 星号“*”也可用于匹配所有端口。 字符串
destinationPortRanges 目标端口范围。 string[]
direction 规则的方向。 direction 指定是要针对传入流量还是传出流量评估该规则。 'Inbound'
需要“出站” ()
priority 规则的优先级。 该值可以介于 100 和 4096 之间。 对于集合中的每个规则,优先级编号必须是唯一的。 优先级编号越低,规则优先级越高。 int (必需)
protocol 此规则应用到的网络协议。 '*'
'Ah'
'Esp'
'Icmp'
'Tcp'
“Udp” (必需)
sourceAddressPrefix CIDR 或源 IP 范围。 也可以使用星号“*”来匹配所有源 IP。 也可以使用默认标记,例如“VirtualNetwork”、“AzureLoadBalancer”和“Internet”。 如果这是入口规则,则指定网络流量的来源。 字符串
sourceAddressPrefixes CIDR 或源 IP 范围。 string[]
sourceApplicationSecurityGroups 指定为源的应用程序安全组。 ApplicationSecurityGroup[]
sourcePortRange 源端口或范围。 介于 0 和 65535 之间的整数或范围。 星号“*”也可用于匹配所有端口。 字符串
sourcePortRanges 源端口范围。 string[]

ApplicationSecurityGroup

名称 说明 Value
id 资源 ID。 字符串
location 资源位置。 string
properties 应用程序安全组的属性。 ApplicationSecurityGroupPropertiesFormat
标记 资源标记。 object

ApplicationSecurityGroupPropertiesFormat

此对象不包含部署期间要设置的任何属性。 所有属性均为 ReadOnly。

RouteTable

名称 说明 Value
id 资源 ID。 字符串
location 资源位置。 string
properties 路由表的属性。 RouteTablePropertiesFormat
标记 资源标记。 object

RouteTablePropertiesFormat

名称 说明
disableBgpRoutePropagation 是否禁用 BGP 在该路由表上获知的路由。 True 表示禁用。 bool
routes 路由表中包含的路由的集合。 Route[]

路由

名称 说明 Value
id 资源 ID。 字符串
name 资源组中唯一的资源的名称。 此名称可用于访问资源。 string
properties 路由的属性。 RoutePropertiesFormat
类型 资源类型。 字符串

RoutePropertiesFormat

名称 说明
addressPrefix 路由应用到的目标 CIDR。 字符串
hasBgpOverride 一个 值,该值指示此路由是否替代重叠的 BGP 路由,而不考虑 LPM。 bool
nextHopIpAddress IP 地址数据包应转发到。 下一跃点值仅在下一跃点类型为 VirtualAppliance 的路由中被允许。 字符串
nextHopType 数据包应发送到的 Azure 跃点的类型。 “Internet”
“None”
“VirtualAppliance”
“VirtualNetworkGateway”
需要“VnetLocal” ()

ServiceEndpointPolicy

名称 说明 Value
id 资源 ID。 字符串
location 资源位置。 string
properties 服务终结点策略的属性。 ServiceEndpointPolicyPropertiesFormat
标记 资源标记。 object

ServiceEndpointPolicyPropertiesFormat

名称 说明
contextualServiceEndpointPolicies 上下文服务终结点策略的集合。 string[]
serviceAlias 指示策略是否属于某个服务的别名 字符串
serviceEndpointPolicyDefinitions 服务终结点策略的服务终结点策略定义的集合。 ServiceEndpointPolicyDefinition[]

ServiceEndpointPolicyDefinition

名称 说明 Value
id 资源 ID。 字符串
name 资源组中唯一的资源的名称。 此名称可用于访问资源。 string
properties 服务终结点策略定义的属性。 ServiceEndpointPolicyDefinitionPropertiesFormat
类型 资源类型。 字符串

ServiceEndpointPolicyDefinitionPropertiesFormat

名称 说明
description 此规则的说明。 限制为 140 个字符。 字符串
服务 服务终结点名称。 字符串
serviceResources 服务资源的列表。 string[]

ServiceEndpointPropertiesFormat

名称 说明
locations 位置列表。 string[]
服务 终结点服务的类型。 字符串

VirtualNetworkPeering

名称 说明 Value
id 资源 ID。 字符串
name 资源组中唯一的资源的名称。 此名称可用于访问资源。 string
properties 虚拟网络对等互连的属性。 VirtualNetworkPeeringPropertiesFormat
类型 资源类型。 字符串

VirtualNetworkPeeringPropertiesFormat

名称 说明
allowForwardedTraffic 远程虚拟网络中是否允许/禁止来自本地虚拟网络中 VM 的转发流量。 bool
allowGatewayTransit 是否可以在远程虚拟网络中使用网关链接来链接到此虚拟网络。 bool
allowVirtualNetworkAccess 本地虚拟网络空间中的 VM 能否访问远程虚拟网络空间中的 VM。 bool
doNotVerifyRemoteGateways 如果需要验证远程网关的预配状态。 bool
peeringState 虚拟网络对等互连的状态。 “Connected”
“Disconnected”
'Initiated'
peeringSyncLevel 虚拟网络对等互连的对等互连同步状态。 “FullyInSync”
'LocalAndRemoteNotInSync'
'LocalNotInSync'
“RemoteNotInSync”
remoteAddressSpace 对与远程虚拟网络对等互连的地址空间的引用。 AddressSpace
remoteBgpCommunities 对远程虚拟网络的 Bgp 社区的引用。 VirtualNetworkBgpCommunities
remoteVirtualNetwork 对远程虚拟网络的引用。 远程虚拟网络可以位于相同或不同的区域中, (预览版) 。 请参阅此处注册预览版,并详细了解 /azure/virtual-network/virtual-network-create-peering) (。 SubResource
remoteVirtualNetworkAddressSpace 对远程虚拟网络的当前地址空间的引用。 AddressSpace
useRemoteGateways 如果远程网关可以在此虚拟网络上使用。 如果该标志设置为 true,并且远程对等互连上的 allowGatewayTransit 也为 true,则虚拟网络将使用远程虚拟网络的网关进行传输。 只有一个对等互连可以将此标志设置为 true。 如果虚拟网络已有网关,则无法设置此标志。 bool

快速入门模板

以下快速入门模板部署此资源类型。

模板 说明
201-vnet-2subnets-service-endpoints-storage-integration

部署到 Azure
在同一 VNet 中的两个不同子网中创建 2 个具有 NIC 的新 VM。 在其中一个子网上设置服务终结点,并将存储帐户保护到该子网。
具有诊断日志的虚拟网络

部署到 Azure
此模板创建包含诊断日志的虚拟网络,并允许将可选功能添加到每个子网
跨两个区域创建 VNET 到 VNET 连接

部署到 Azure
此模板允许使用 虚拟网络 网关连接不同区域中的两个 VNET
创建 BGP VNET 到 VNET 连接

部署到 Azure
此模板允许使用 虚拟网络 网关和 BGP 连接两个 VNET
使用 vNet 对等互连创建 vNet 到 vNet 连接

部署到 Azure
此模板允许使用 vNet 对等互连连接两个 vNet
创建三个 vNet 来演示可传递 BGP 连接

部署到 Azure
此模板部署使用虚拟网络网关和已启用 BGP 的连接连接的三个 vNet
创建包含两个子网的虚拟网络

部署到 Azure
此模板允许创建包含两个子网的虚拟网络。

Terraform (AzAPI 提供程序) 资源定义

可以使用面向以下操作部署 virtualNetworks 资源类型:

  • 资源组

有关每个 API 版本中已更改属性的列表,请参阅 更改日志

资源格式

若要创建 Microsoft.Network/virtualNetworks 资源,请将以下 Terraform 添加到模板。

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.Network/virtualNetworks@2023-04-01"
  name = "string"
  location = "string"
  parent_id = "string"
  tags = {
    tagName1 = "tagValue1"
    tagName2 = "tagValue2"
  }
  body = jsonencode({
    properties = {
      addressSpace = {
        addressPrefixes = [
          "string"
        ]
      }
      bgpCommunities = {
        virtualNetworkCommunity = "string"
      }
      ddosProtectionPlan = {
        id = "string"
      }
      dhcpOptions = {
        dnsServers = [
          "string"
        ]
      }
      enableDdosProtection = bool
      enableVmProtection = bool
      encryption = {
        enabled = bool
        enforcement = "string"
      }
      flowTimeoutInMinutes = int
      ipAllocations = [
        {
          id = "string"
        }
      ]
      subnets = [
        {
          id = "string"
          name = "string"
          properties = {
            addressPrefix = "string"
            addressPrefixes = [
              "string"
            ]
            applicationGatewayIPConfigurations = [
              {
                id = "string"
                name = "string"
                properties = {
                  subnet = {
                    id = "string"
                  }
                }
              }
            ]
            delegations = [
              {
                id = "string"
                name = "string"
                properties = {
                  serviceName = "string"
                }
                type = "string"
              }
            ]
            ipAllocations = [
              {
                id = "string"
              }
            ]
            natGateway = {
              id = "string"
            }
            networkSecurityGroup = {
              id = "string"
              location = "string"
              properties = {
                flushConnection = bool
                securityRules = [
                  {
                    id = "string"
                    name = "string"
                    properties = {
                      access = "string"
                      description = "string"
                      destinationAddressPrefix = "string"
                      destinationAddressPrefixes = [
                        "string"
                      ]
                      destinationApplicationSecurityGroups = [
                        {
                          id = "string"
                          location = "string"
                          properties = {}
                          tags = {}
                        }
                      ]
                      destinationPortRange = "string"
                      destinationPortRanges = [
                        "string"
                      ]
                      direction = "string"
                      priority = int
                      protocol = "string"
                      sourceAddressPrefix = "string"
                      sourceAddressPrefixes = [
                        "string"
                      ]
                      sourceApplicationSecurityGroups = [
                        {
                          id = "string"
                          location = "string"
                          properties = {}
                          tags = {}
                        }
                      ]
                      sourcePortRange = "string"
                      sourcePortRanges = [
                        "string"
                      ]
                    }
                    type = "string"
                  }
                ]
              }
              tags = {}
            }
            privateEndpointNetworkPolicies = "string"
            privateLinkServiceNetworkPolicies = "string"
            routeTable = {
              id = "string"
              location = "string"
              properties = {
                disableBgpRoutePropagation = bool
                routes = [
                  {
                    id = "string"
                    name = "string"
                    properties = {
                      addressPrefix = "string"
                      hasBgpOverride = bool
                      nextHopIpAddress = "string"
                      nextHopType = "string"
                    }
                    type = "string"
                  }
                ]
              }
              tags = {}
            }
            serviceEndpointPolicies = [
              {
                id = "string"
                location = "string"
                properties = {
                  contextualServiceEndpointPolicies = [
                    "string"
                  ]
                  serviceAlias = "string"
                  serviceEndpointPolicyDefinitions = [
                    {
                      id = "string"
                      name = "string"
                      properties = {
                        description = "string"
                        service = "string"
                        serviceResources = [
                          "string"
                        ]
                      }
                      type = "string"
                    }
                  ]
                }
                tags = {}
              }
            ]
            serviceEndpoints = [
              {
                locations = [
                  "string"
                ]
                service = "string"
              }
            ]
          }
          type = "string"
        }
      ]
      virtualNetworkPeerings = [
        {
          id = "string"
          name = "string"
          properties = {
            allowForwardedTraffic = bool
            allowGatewayTransit = bool
            allowVirtualNetworkAccess = bool
            doNotVerifyRemoteGateways = bool
            peeringState = "string"
            peeringSyncLevel = "string"
            remoteAddressSpace = {
              addressPrefixes = [
                "string"
              ]
            }
            remoteBgpCommunities = {
              virtualNetworkCommunity = "string"
            }
            remoteVirtualNetwork = {
              id = "string"
            }
            remoteVirtualNetworkAddressSpace = {
              addressPrefixes = [
                "string"
              ]
            }
            useRemoteGateways = bool
          }
          type = "string"
        }
      ]
    }
    extendedLocation = {
      name = "string"
      type = "EdgeZone"
    }
  })
}

属性值

virtualNetworks

名称 说明 Value
type 资源类型 “Microsoft.Network/virtualNetworks@2023-04-01”
name 资源名称 字符串 (必需)

字符限制:2-64

有效字符:
字母数字、下划线字符、句点和连字符。

以字母数字开头。 以字母数字或下划线结尾。
location 资源位置。 字符串
parent_id 若要部署到资源组,请使用该资源组的 ID。 字符串 (必需)
标记 资源标记。 标记名称和值的字典。
extendedLocation 虚拟网络的扩展位置。 ExtendedLocation
properties 虚拟网络的属性。 VirtualNetworkPropertiesFormat

ExtendedLocation

名称 说明
name 扩展位置的名称。 字符串
type 扩展位置的类型。 “EdgeZone”

VirtualNetworkPropertiesFormat

名称 说明
addressSpace AddressSpace,其中包含子网可以使用的 IP 地址范围数组。 AddressSpace
bgp 社区 通过 ExpressRoute 发送的 Bgp 社区,每个路由对应于此 VNET 中的前缀。 VirtualNetworkBgpCommunities
ddosProtectionPlan 与虚拟网络关联的 DDoS 保护计划。 SubResource
dhcpOptions dhcpOptions,其中包含可用于虚拟网络中部署的 VM 的 DNS 服务器数组。 DhcpOptions
enableDdosProtection 指示是否为虚拟网络中的所有受保护资源启用了 DDoS 保护。 它需要与资源关联的 DDoS 保护计划。 bool
enableVmProtection 指示是否为虚拟网络中的所有子网启用了 VM 保护。 bool
加密 指示是否在虚拟网络上启用了加密,以及是否允许在加密的 VNet 中启用不加密的 VM。 VirtualNetworkEncryption
flowTimeoutInMinutes 虚拟网络的 FlowTimeout 值以分钟) ( int
ipAllocations 引用此 VNET 的 IpAllocation 数组。 SubResource[]
subnets 虚拟网络中的子网列表。 Subnet[]
virtualNetworkPeerings 虚拟网络中的对等互连列表。 VirtualNetworkPeering[]

AddressSpace

名称 说明
addressPrefixes 以 CIDR 表示法为此虚拟网络保留的地址块列表。 string[]

VirtualNetworkBgpCommunities

名称 说明
virtualNetworkCommunity 与虚拟网络关联的 BGP 社区。 字符串 (必需)

SubResource

名称 说明 Value
id 资源 ID。 字符串

DhcpOptions

名称 说明
dnsServers DNS 服务器 IP 地址的列表。 string[]

VirtualNetworkEncryption

名称 说明
enabled 指示是否在虚拟网络上启用了加密。 需要 bool ()
执法 如果加密的 VNet 允许不支持加密的 VM “AllowUnencrypted”
“DropUnencrypted”

子网

名称 说明 Value
id 资源 ID。 字符串
name 资源组中唯一的资源的名称。 此名称可用于访问资源。 string
properties 子网的属性。 SubnetPropertiesFormat
类型 资源类型。 字符串

SubnetPropertiesFormat

名称 说明
addressPrefix 子网的地址前缀。 字符串
addressPrefixes 子网的地址前缀列表。 string[]
applicationGatewayIPConfigurations 虚拟网络资源的应用程序网关 IP 配置。 ApplicationGatewayIPConfiguration[]
代表团 对子网上委托的引用数组。 委派[]
ipAllocations 引用此子网的 IpAllocation 数组。 SubResource[]
natGateway 与此子网关联的 Nat 网关。 SubResource
networkSecurityGroup 对 NetworkSecurityGroup 资源的引用。 NetworkSecurityGroup
privateEndpointNetworkPolicies 启用或禁用在子网中的专用终结点应用网络策略。 “Disabled”
“Enabled”
privateLinkServiceNetworkPolicies 启用或禁用对子网中的专用链接服务应用网络策略。 “Disabled”
“Enabled”
routeTable 对 RouteTable 资源的引用。 RouteTable
serviceEndpointPolicies 服务终结点策略的数组。 ServiceEndpointPolicy[]
serviceEndpoints 服务终结点的数组。 ServiceEndpointPropertiesFormat[]

ApplicationGatewayIPConfiguration

名称 说明 Value
id 资源 ID。 字符串
name 应用程序网关中唯一的 IP 配置的名称。 string
properties 应用程序网关 IP 配置的属性。 ApplicationGatewayIPConfigurationPropertiesFormat

ApplicationGatewayIPConfigurationPropertiesFormat

名称 说明
子网 对子网资源的引用。 应用程序网关从中获取其专用地址的子网。 SubResource

委托

名称 说明 Value
id 资源 ID。 字符串
name 子网中唯一的资源的名称。 此名称可用于访问资源。 string
properties 子网的属性。 ServiceDelegationPropertiesFormat
类型 资源类型。 字符串

ServiceDelegationPropertiesFormat

名称 说明
serviceName 子网应委托给的服务的名称, (例如 Microsoft.Sql/servers) 。 字符串

NetworkSecurityGroup

名称 说明 Value
id 资源 ID。 字符串
location 资源位置。 string
properties 网络安全组的属性。 NetworkSecurityGroupPropertiesFormat
标记 资源标记。 object

NetworkSecurityGroupPropertiesFormat

名称 说明
flushConnection 启用后,当规则更新时,将从网络安全组连接创建的流重新评估。 初始启用将触发重新评估。 bool
securityRules 网络安全组的安全规则的集合。 SecurityRule[]

SecurityRule

名称 说明 Value
id 资源 ID。 字符串
name 资源组中唯一的资源的名称。 此名称可用于访问资源。 string
properties 安全规则的属性。 SecurityRulePropertiesFormat
类型 资源类型。 字符串

SecurityRulePropertiesFormat

名称 说明
access 允许或拒绝网络流量。 “允许”
需要“拒绝” ()
description 此规则的说明。 限制为 140 个字符。 字符串
destinationAddressPrefix 目标地址前缀。 CIDR 或目标 IP 范围。 也可以使用星号“*”来匹配所有源 IP。 也可以使用默认标记,例如“VirtualNetwork”、“AzureLoadBalancer”和“Internet”。 字符串
destinationAddressPrefixes 目标地址前缀。 CIDR 或目标 IP 范围。 string[]
destinationApplicationSecurityGroups 指定为目标的应用程序安全组。 ApplicationSecurityGroup[]
destinationPortRange 目标端口或范围。 介于 0 和 65535 之间的整数或范围。 星号“*”也可用于匹配所有端口。 字符串
destinationPortRanges 目标端口范围。 string[]
direction 规则的方向。 direction 指定是要针对传入流量还是传出流量评估该规则。 “入站”
“出站” (必需)
priority 规则的优先级。 该值可以介于 100 和 4096 之间。 集合中每个规则的优先级编号必须是唯一的。 优先级编号越低,规则优先级越高。 int (必需)
protocol 此规则应用到的网络协议。 "*"
“啊”
“Esp”
“Icmp”
“Tcp”
“Udp” (必需)
sourceAddressPrefix CIDR 或源 IP 范围。 也可以使用星号“*”来匹配所有源 IP。 也可以使用“VirtualNetwork”、“AzureLoadBalancer”和“Internet”等默认标记。 如果这是入口规则,则指定网络流量的来源。 字符串
sourceAddressPrefixes CIDR 或源 IP 范围。 string[]
sourceApplicationSecurityGroups 指定为源的应用程序安全组。 ApplicationSecurityGroup[]
sourcePortRange 源端口或范围。 介于 0 和 65535 之间的整数或范围。 星号“*”也可用于匹配所有端口。 字符串
sourcePortRanges 源端口范围。 string[]

ApplicationSecurityGroup

名称 说明 Value
id 资源 ID。 字符串
location 资源位置。 string
properties 应用程序安全组的属性。 ApplicationSecurityGroupPropertiesFormat
标记 资源标记。 object

ApplicationSecurityGroupPropertiesFormat

此对象不包含在部署期间要设置的任何属性。 所有属性均为 ReadOnly。

RouteTable

名称 说明 Value
id 资源 ID。 字符串
location 资源位置。 string
properties 路由表的属性。 RouteTablePropertiesFormat
标记 资源标记。 object

RouteTablePropertiesFormat

名称 说明
disableBgpRoutePropagation 是否禁用 BGP 在该路由表上学习的路由。 True 表示禁用。 bool
routes 路由表中包含的路由的集合。 Route[]

路由

名称 说明 Value
id 资源 ID。 字符串
name 资源组中唯一的资源的名称。 此名称可用于访问资源。 string
properties 路由的属性。 RoutePropertiesFormat
类型 资源类型。 字符串

RoutePropertiesFormat

名称 说明
addressPrefix 路由应用到的目标 CIDR。 字符串
hasBgpOverride 一个 值,该值指示此路由是否替代重叠的 BGP 路由,而不考虑 LPM。 bool
nextHopIpAddress IP 地址数据包应转发到。 下一跃点值仅在下一跃点类型为 VirtualAppliance 的路由中被允许。 字符串
nextHopType 数据包应发送到的 Azure 跃点的类型。 “Internet”
"None"
“VirtualAppliance”
“VirtualNetworkGateway”
“VnetLocal” (必需)

ServiceEndpointPolicy

名称 说明 Value
id 资源 ID。 字符串
location 资源位置。 string
properties 服务终结点策略的属性。 ServiceEndpointPolicyPropertiesFormat
标记 资源标记。 object

ServiceEndpointPolicyPropertiesFormat

名称 说明
contextualServiceEndpointPolicies 上下文服务终结点策略的集合。 string[]
serviceAlias 指示策略是否属于某个服务的别名 字符串
serviceEndpointPolicyDefinitions 服务终结点策略的服务终结点策略定义的集合。 ServiceEndpointPolicyDefinition[]

ServiceEndpointPolicyDefinition

名称 说明 Value
id 资源 ID。 字符串
name 资源组中唯一的资源的名称。 此名称可用于访问资源。 string
properties 服务终结点策略定义的属性。 ServiceEndpointPolicyDefinitionPropertiesFormat
类型 资源类型。 字符串

ServiceEndpointPolicyDefinitionPropertiesFormat

名称 说明
description 此规则的说明。 限制为 140 个字符。 字符串
服务 服务终结点名称。 字符串
serviceResources 服务资源的列表。 string[]

ServiceEndpointPropertiesFormat

名称 说明
locations 位置列表。 string[]
服务 终结点服务的类型。 字符串

VirtualNetworkPeering

名称 说明 Value
id 资源 ID。 字符串
name 资源组中唯一的资源的名称。 此名称可用于访问资源。 string
properties 虚拟网络对等互连的属性。 VirtualNetworkPeeringPropertiesFormat
类型 资源类型。 字符串

VirtualNetworkPeeringPropertiesFormat

名称 说明
allowForwardedTraffic 远程虚拟网络中是否允许/禁止来自本地虚拟网络中 VM 的转发流量。 bool
allowGatewayTransit 是否可以在远程虚拟网络中使用网关链接来链接到此虚拟网络。 bool
allowVirtualNetworkAccess 本地虚拟网络空间中的 VM 是否能够访问远程虚拟网络空间中的 VM。 bool
doNotVerifyRemoteGateways 如果需要验证远程网关的预配状态。 bool
peeringState 虚拟网络对等互连的状态。 “已连接”
“已断开连接”
“已启动”
peeringSyncLevel 虚拟网络对等互连的对等互连同步状态。 “FullyInSync”
“LocalAndRemoteNotInSync”
“LocalNotInSync”
“RemoteNotInSync”
remoteAddressSpace 对与远程虚拟网络对等互连的地址空间的引用。 AddressSpace
remoteBgp 社区 对远程虚拟网络的 Bgp 社区的引用。 VirtualNetworkBgp 社区
remoteVirtualNetwork 对远程虚拟网络的引用。 远程虚拟网络可以位于预览) (相同或不同的区域。 若要注册预览版,并详细了解 /azure/virtual-network/virtual-network-create-peering) (。 SubResource
remoteVirtualNetworkAddressSpace 对远程虚拟网络的当前地址空间的引用。 AddressSpace
useRemoteGateways 如果远程网关可以在此虚拟网络上使用。 如果标志设置为 true,并且允许远程对等互连上的 allowGatewayTransit 也为 true,则虚拟网络将使用远程虚拟网络的网关进行传输。 只有一个对等互连可以将此标志设置为 true。 如果虚拟网络已有网关,则无法设置此标志。 bool