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 資源位置。 string
tags 資源標籤。 標記名稱和值的字典。 請參閱 範本中的標籤
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[]
子網路 虛擬網路中的子網清單。 Subnet[]
virtualNetworkPeerings 虛擬網路中的對等互連清單。 VirtualNetworkPeering[]

AddressSpace

名稱 描述
addressPrefixes 以 CIDR 標記法保留給此虛擬網路的位址區塊清單。 string[]

VirtualNetworkBgp 社群

名稱 描述
virtualNetworkCo一 與虛擬網路相關聯的 BGP 社群。 需要字串 ()

SubResource

名稱 描述
id 資源識別碼。 string

DhcpOptions

名稱 描述
dnsServers DNS 伺服器 IP 位址的清單。 string[]

VirtualNetworkEncryption

名稱 描述
已啟用 指出虛擬網路上是否啟用加密。 bool (必要)
執法 如果加密的 VNet 允許不支援加密的 VM 'AllowUnencrypted'
'DropUnencrypted'

子網路

名稱 描述
id 資源識別碼。 字串
NAME 資源群組內唯一的資源名稱。 此名稱可用來存取資源。 string
properties 子網的屬性。 SubnetPropertiesFormat
類型 資源類型。 string

SubnetPropertiesFormat

名稱 描述
addressPrefix 子網的位址前置詞。 string
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

名稱 描述
id 資源識別碼。 字串
NAME 應用程式閘道內唯一的 IP 組態名稱。 string
properties 應用程式閘道 IP 組態的屬性。 ApplicationGatewayIPConfigurationPropertiesFormat

ApplicationGatewayIPConfigurationPropertiesFormat

名稱 描述
子網路 子網資源的參考。 應用程式閘道從其中取得其私人位址的子網。 SubResource

委派

名稱 描述
id 資源識別碼。 字串
NAME 子網內唯一的資源名稱。 此名稱可用來存取資源。 string
properties 子網的屬性。 ServiceDelegationPropertiesFormat
類型 資源類型。 string

ServiceDelegationPropertiesFormat

名稱 描述
serviceName 子網應委派給的服務名稱 (例如 Microsoft.Sql/servers) 。 string

NetworkSecurityGroup

名稱 描述
id 資源識別碼。 string
location 資源位置。 string
properties 網路安全性群組的屬性。 NetworkSecurityGroupPropertiesFormat
tags 資源標籤。 object

NetworkSecurityGroupPropertiesFormat

名稱 描述
flushConnection 啟用時,從網路安全性群組連線建立的流程會在更新規則時重新評估。 初始啟用將會觸發重新評估。 bool
securityRules 網路安全性群組的安全性規則集合。 SecurityRule[]

SecurityRule

名稱 描述
id 資源識別碼。 字串
NAME 資源群組內唯一的資源名稱。 此名稱可用來存取資源。 string
properties 安全性規則的屬性。 SecurityRulePropertiesFormat
類型 資源類型。 string

SecurityRulePropertiesFormat

名稱 描述
access 允許或拒絕網路流量。 'Allow'
必要) ('Deny'
description 此規則的說明。 限制為 140 個字元。 string
destinationAddressPrefix 目的地位址前置詞。 CIDR 或目的地 IP 範圍。 也可用星號 (*) 來比對所有的來源 IP。 您也可以使用預設標籤,例如 'VirtualNetwork'、'AzureLoadBalancer' 和 'Internet'。 string
destinationAddressPrefixes 目的地位址前置詞。 CIDR 或目的地 IP 範圍。 string[]
destinationApplicationSecurityGroups 指定為目的地的應用程式安全性群組。 ApplicationSecurityGroup[]
destinationPortRange 目的地埠或範圍。 介於 0 到 65535 之間的整數或範圍。 星號 '*' 也可以用來比對所有埠。 string
destinationPortRanges 目的地埠範圍。 string[]
direction 規則的方向。 此方向指定是否根據連入或連出的流量評估規則。 'Inbound'
必要的「輸出」 ()
priority 規則的優先順序。 此值可以介於 100 到 4096 之間。 集合中每個規則的優先順序數位必須是唯一的。 優先順序號碼愈小,規則優先順序就愈高。 int (必要)
protocol 此規則適用的網路通訊協定。 '*'
'Ah'
'Esp'
'Icmp'
'Tcp'
需要 'Udp' ()
sourceAddressPrefix CIDR 或來源 IP 範圍。 也可用星號 (*) 來比對所有的來源 IP。 您也可以使用預設標籤,例如 'VirtualNetwork'、'AzureLoadBalancer' 和 'Internet'。 如果這是輸入規則,請指定網路流量的來源。 string
sourceAddressPrefixes CIDR 或來源 IP 範圍。 string[]
sourceApplicationSecurityGroups 指定為來源的應用程式安全性群組。 ApplicationSecurityGroup[]
sourcePortRange 來源埠或範圍。 介於 0 到 65535 之間的整數或範圍。 星號 '*' 也可以用來比對所有埠。 string
sourcePortRanges 來源埠範圍。 string[]

ApplicationSecurityGroup

名稱 描述
id 資源識別碼。 string
location 資源位置。 string
properties 應用程式安全性群組的屬性。 ApplicationSecurityGroupPropertiesFormat
tags 資源標籤。 object

ApplicationSecurityGroupPropertiesFormat

此物件不包含部署期間要設定的任何屬性。 所有屬性都是 ReadOnly。

RouteTable

名稱 描述
id 資源識別碼。 string
location 資源位置。 string
properties 路由表的屬性。 RouteTablePropertiesFormat
tags 資源標籤。 object

RouteTablePropertiesFormat

名稱 描述
disableBgpRoutePropagation 是否要在該路由表上停用 BGP 所學習的路由。 True 表示停用。 bool
路由 路由表中包含的路由集合。 Route[]

路由

名稱 描述
id 資源識別碼。 字串
NAME 資源群組內唯一的資源名稱。 此名稱可用來存取資源。 string
properties 路由的屬性。 RoutePropertiesFormat
類型 資源類型。 string

RoutePropertiesFormat

名稱 描述
addressPrefix 路由套用的目標 CIDR。 string
hasBgpOverride 值,指出不論 LPM 為何,此路由是否覆寫重迭的 BGP 路由。 bool
nextHopIpAddress IP 位址封包應轉送至 。 只有在下一個躍點類型為 VirtualAppliance 的路由中,才允許下一個躍點值。 string
nextHopType 要接收封包的 Azure 躍點的類型。 'Internet'
'None'
'VirtualAppliance'
'VirtualNetworkGateway'
'VnetLocal' (必要)

ServiceEndpointPolicy

名稱 描述
id 資源識別碼。 string
location 資源位置。 string
properties 服務端點原則的屬性。 ServiceEndpointPolicyPropertiesFormat
tags 資源標籤。 object

ServiceEndpointPolicyPropertiesFormat

名稱 描述
coNtextualServiceEndpointPolicies 關聯式服務端點原則的集合。 string[]
serviceAlias 別名,指出原則是否屬於服務 string
serviceEndpointPolicyDefinitions 服務端點原則的服務端點原則定義集合。 ServiceEndpointPolicyDefinition[]

ServiceEndpointPolicyDefinition

名稱 描述
id 資源識別碼。 字串
NAME 資源群組內唯一的資源名稱。 此名稱可用來存取資源。 string
properties 服務端點原則定義的屬性。 ServiceEndpointPolicyDefinitionPropertiesFormat
類型 資源類型。 string

ServiceEndpointPolicyDefinitionPropertiesFormat

名稱 描述
description 此規則的說明。 限制為 140 個字元。 string
服務 服務端點名稱。 string
serviceResources 服務資源清單。 string[]

ServiceEndpointPropertiesFormat

名稱 描述
位置 位置清單。 string[]
服務 端點服務的型別。 string

VirtualNetworkPeering

名稱 描述
id 資源識別碼。 字串
NAME 資源群組內唯一的資源名稱。 此名稱可用來存取資源。 string
properties 虛擬網路對等互連的屬性。 VirtualNetworkPeeringPropertiesFormat
類型 資源類型。 string

VirtualNetworkPeeringPropertiesFormat

名稱 描述
allowForwardedTraffic 遠端虛擬網路中是否允許/不允許來自本機虛擬網路中 VM 的轉送流量。 bool
allowGatewayTransit 如果閘道連結可用於遠端虛擬網路,則連結至此虛擬網路。 bool
allowVirtualNetworkAccess 本機虛擬網路空間中的 VM 是否能夠存取遠端虛擬網路空間中的 VM。 bool
doNotVerifyRemoteGateways 如果需要驗證遠端閘道的布建狀態。 bool
peeringState 虛擬網路對等互連的狀態。 'Connected'
'Disconnected'
'起始'
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。 如果虛擬網路已經有閘道,則無法設定此旗標。 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

名稱 描述
類型 資源類型 'Microsoft.Network/virtualNetworks'
apiVersion 資源 API 版本 '2023-04-01'
NAME 資源名稱 需要字串 ()

字元限制:2-64

有效字元:
英數字元、底線、句號和連字號。

以英數字元開頭。 以英數字元或底線結尾。
location 資源位置。 string
tags 資源標籤。 標記名稱和值的字典。 請參閱 範本中的標籤
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[]
子網路 虛擬網路中的子網清單。 Subnet[]
virtualNetworkPeerings 虛擬網路中的對等互連清單。 VirtualNetworkPeering[]

AddressSpace

名稱 描述
addressPrefixes 以 CIDR 標記法保留給此虛擬網路的位址區塊清單。 string[]

VirtualNetworkBgp 社群

名稱 描述
virtualNetworkCo一 與虛擬網路相關聯的 BGP 社群。 需要字串 ()

SubResource

名稱 描述
id 資源識別碼。 string

DhcpOptions

名稱 描述
dnsServers DNS 伺服器 IP 位址的清單。 string[]

VirtualNetworkEncryption

名稱 描述
已啟用 指出虛擬網路上是否啟用加密。 bool (必要)
執法 如果加密的 VNet 允許不支援加密的 VM 'AllowUnencrypted'
'DropUnencrypted'

子網路

名稱 描述
id 資源識別碼。 字串
NAME 資源群組內唯一的資源名稱。 此名稱可用來存取資源。 string
properties 子網的屬性。 SubnetPropertiesFormat
類型 資源類型。 string

SubnetPropertiesFormat

名稱 描述
addressPrefix 子網的位址前置詞。 string
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

名稱 描述
id 資源識別碼。 字串
NAME 應用程式閘道內唯一的 IP 組態名稱。 string
properties 應用程式閘道 IP 組態的屬性。 ApplicationGatewayIPConfigurationPropertiesFormat

ApplicationGatewayIPConfigurationPropertiesFormat

名稱 描述
子網路 子網資源的參考。 應用程式閘道從其中取得其私人位址的子網。 SubResource

委派

名稱 描述
id 資源識別碼。 字串
NAME 子網內唯一的資源名稱。 此名稱可用來存取資源。 string
properties 子網的屬性。 ServiceDelegationPropertiesFormat
類型 資源類型。 string

ServiceDelegationPropertiesFormat

名稱 描述
serviceName 子網應委派給的服務名稱 (例如 Microsoft.Sql/servers) 。 string

NetworkSecurityGroup

名稱 描述
id 資源識別碼。 string
location 資源位置。 string
properties 網路安全性群組的屬性。 NetworkSecurityGroupPropertiesFormat
tags 資源標籤。 object

NetworkSecurityGroupPropertiesFormat

名稱 描述
flushConnection 啟用時,從網路安全性群組連線建立的流程會在更新規則時重新評估。 初始啟用將會觸發重新評估。 bool
securityRules 網路安全性群組的安全性規則集合。 SecurityRule[]

SecurityRule

名稱 描述
id 資源識別碼。 字串
NAME 資源群組內唯一的資源名稱。 此名稱可用來存取資源。 string
properties 安全性規則的屬性。 SecurityRulePropertiesFormat
類型 資源類型。 string

SecurityRulePropertiesFormat

名稱 描述
access 允許或拒絕網路流量。 'Allow'
必要) ('Deny'
description 此規則的說明。 限制為 140 個字元。 string
destinationAddressPrefix 目的地位址前置詞。 CIDR 或目的地 IP 範圍。 也可用星號 (*) 來比對所有的來源 IP。 您也可以使用預設標籤,例如 'VirtualNetwork'、'AzureLoadBalancer' 和 'Internet'。 string
destinationAddressPrefixes 目的地位址前置詞。 CIDR 或目的地 IP 範圍。 string[]
destinationApplicationSecurityGroups 指定為目的地的應用程式安全性群組。 ApplicationSecurityGroup[]
destinationPortRange 目的地埠或範圍。 介於 0 到 65535 之間的整數或範圍。 星號 '*' 也可以用來比對所有埠。 string
destinationPortRanges 目的地埠範圍。 string[]
direction 規則的方向。 此方向指定是否根據連入或連出的流量評估規則。 'Inbound'
「輸出」 (必要)
priority 規則的優先順序。 此值可以介於 100 到 4096 之間。 集合中每個規則的優先順序數位必須是唯一的。 優先順序號碼愈小,規則優先順序就愈高。 需要 int ()
protocol 此規則適用的網路通訊協定。 '*'
'Ah'
'Esp'
'Icmp'
'Tcp'
必要 'Udp' ()
sourceAddressPrefix CIDR 或來源 IP 範圍。 也可用星號 (*) 來比對所有的來源 IP。 您也可以使用預設標籤,例如 'VirtualNetwork'、'AzureLoadBalancer' 和 'Internet'。 如果這是輸入規則,請指定網路流量的來源。 string
sourceAddressPrefixes CIDR 或來源 IP 範圍。 string[]
sourceApplicationSecurityGroups 指定為來源的應用程式安全性群組。 ApplicationSecurityGroup[]
sourcePortRange 來源埠或範圍。 介於 0 到 65535 之間的整數或範圍。 星號 '*' 也可以用來比對所有埠。 string
sourcePortRanges 來源埠範圍。 string[]

ApplicationSecurityGroup

名稱 描述
id 資源識別碼。 string
location 資源位置。 string
properties 應用程式安全性群組的屬性。 ApplicationSecurityGroupPropertiesFormat
tags 資源標籤。 object

ApplicationSecurityGroupPropertiesFormat

此物件不包含部署期間要設定的任何屬性。 所有屬性都是 ReadOnly。

RouteTable

名稱 描述
id 資源識別碼。 string
location 資源位置。 string
properties 路由表的屬性。 RouteTablePropertiesFormat
tags 資源標籤。 object

RouteTablePropertiesFormat

名稱 描述
disableBgpRoutePropagation 是否要停用 BGP 在該路由表上學習的路由。 True 表示停用。 bool
路由 路由表中包含的路由集合。 Route[]

路由

名稱 描述
id 資源識別碼。 字串
NAME 資源群組內唯一的資源名稱。 此名稱可用來存取資源。 string
properties 路由的屬性。 RoutePropertiesFormat
類型 資源類型。 string

RoutePropertiesFormat

名稱 描述
addressPrefix 路由套用的目標 CIDR。 string
hasBgpOverride 值,指出不論 LPM 為何,此路由是否覆寫重迭的 BGP 路由。 bool
nextHopIpAddress IP 位址封包應轉送至 。 下一個躍點值只能在下一個躍點類型為 VirtualAppliance 的路由中允許。 string
nextHopType 要接收封包的 Azure 躍點的類型。 'Internet'
'None'
'VirtualAppliance'
'VirtualNetworkGateway'
'VnetLocal' (必要)

ServiceEndpointPolicy

名稱 描述
id 資源識別碼。 string
location 資源位置。 string
properties 服務端點原則的屬性。 ServiceEndpointPolicyPropertiesFormat
tags 資源標籤。 object

ServiceEndpointPolicyPropertiesFormat

名稱 描述
coNtextualServiceEndpointPolicies 內容服務端點原則的集合。 string[]
serviceAlias 指出原則是否屬於服務的別名 string
serviceEndpointPolicyDefinitions 服務端點原則的服務端點原則定義集合。 ServiceEndpointPolicyDefinition[]

ServiceEndpointPolicyDefinition

名稱 描述
id 資源識別碼。 字串
NAME 資源群組內唯一的資源名稱。 此名稱可用來存取資源。 string
properties 服務端點原則定義的屬性。 ServiceEndpointPolicyDefinitionPropertiesFormat
類型 資源類型。 string

ServiceEndpointPolicyDefinitionPropertiesFormat

名稱 描述
description 此規則的說明。 限制為 140 個字元。 string
服務 服務端點名稱。 string
serviceResources 服務資源的清單。 string[]

ServiceEndpointPropertiesFormat

名稱 描述
位置 位置清單。 string[]
服務 端點服務的型別。 string

VirtualNetworkPeering

名稱 描述
id 資源識別碼。 字串
NAME 資源群組內唯一的資源名稱。 此名稱可用來存取資源。 string
properties 虛擬網路對等互連的屬性。 VirtualNetworkPeeringPropertiesFormat
類型 資源類型。 string

VirtualNetworkPeeringPropertiesFormat

名稱 描述
allowForwardedTraffic 遠端虛擬網路中是否允許/不允許來自本機虛擬網路中 VM 的轉送流量。 bool
allowGatewayTransit 如果閘道連結可用於遠端虛擬網路,以連結至此虛擬網路。 bool
allowVirtualNetworkAccess 區域網路空間中的 VM 是否能夠存取遠端虛擬網路空間中的 VM。 bool
doNotVerifyRemoteGateways 如果需要驗證遠端閘道的布建狀態。 bool
peeringState 虛擬網路對等互連的狀態。 'Connected'
'Disconnected'
'Initiated'
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

快速入門範本

下列快速入門範本會部署此資源類型。

[範本] 描述
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

名稱 描述
類型 資源類型 「Microsoft.Network/virtualNetworks@2023-04-01」
NAME 資源名稱 字串 (必要)

字元限制:2-64

有效字元:
英數字元、底線、句號和連字號。

以英數字元開頭。 以英數字元或底線結尾。
location 資源位置。 string
parent_id 若要部署至資源群組,請使用該資源群組的識別碼。 字串 (必要)
tags 資源標籤。 標記名稱和值的字典。
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[]
子網路 虛擬網路中的子網清單。 Subnet[]
virtualNetworkPeerings 虛擬網路中的對等互連清單。 VirtualNetworkPeering[]

AddressSpace

名稱 描述
addressPrefixes 在 CIDR 標記法中保留給此虛擬網路的位址區塊清單。 string[]

VirtualNetworkBgp 社群

名稱 描述
virtualNetworkCommunity 與虛擬網路相關聯的 BGP 社群。 字串 (必要)

SubResource

名稱 描述
id 資源識別碼。 string

DhcpOptions

名稱 描述
dnsServers DNS 伺服器 IP 位址的清單。 string[]

VirtualNetworkEncryption

名稱 描述
已啟用 指出虛擬網路上是否啟用加密。 bool (必要)
執法 如果加密的 VNet 允許不支援加密的 VM 「AllowUnencrypted」
「DropUnencrypted」

子網路

名稱 描述
id 資源識別碼。 字串
NAME 資源群組內唯一的資源名稱。 此名稱可用來存取資源。 string
properties 子網的屬性。 SubnetPropertiesFormat
類型 資源類型。 string

SubnetPropertiesFormat

名稱 描述
addressPrefix 子網的位址前置詞。 string
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

名稱 描述
id 資源識別碼。 字串
NAME 應用程式閘道內唯一的 IP 組態名稱。 string
properties 應用程式閘道 IP 組態的屬性。 ApplicationGatewayIPConfigurationPropertiesFormat

ApplicationGatewayIPConfigurationPropertiesFormat

名稱 描述
子網路 子網資源的參考。 應用程式閘道從中取得其私人位址的子網。 SubResource

委派

名稱 描述
id 資源識別碼。 字串
NAME 子網內唯一的資源名稱。 此名稱可用來存取資源。 string
properties 子網的屬性。 ServiceDelegationPropertiesFormat
類型 資源類型。 string

ServiceDelegationPropertiesFormat

名稱 描述
serviceName 子網應委派給的服務名稱 (,例如 Microsoft.Sql/servers) 。 string

NetworkSecurityGroup

名稱 描述
id 資源識別碼。 string
location 資源位置。 string
properties 網路安全性群組的屬性。 NetworkSecurityGroupPropertiesFormat
tags 資源標籤。 object

NetworkSecurityGroupPropertiesFormat

名稱 描述
flushConnection 啟用時,從網路安全性群組連線建立的流程會在更新規則時重新評估。 初始啟用將會觸發重新評估。 bool
securityRules 網路安全性群組的安全性規則集合。 SecurityRule[]

SecurityRule

名稱 描述
id 資源識別碼。 字串
NAME 資源群組內唯一的資源名稱。 此名稱可用來存取資源。 string
properties 安全性規則的屬性。 SecurityRulePropertiesFormat
類型 資源類型。 string

SecurityRulePropertiesFormat

名稱 描述
access 允許或拒絕網路流量。 「允許」
「Deny」 (必要)
description 此規則的說明。 限制為 140 個字元。 string
destinationAddressPrefix 目的地位址首碼。 CIDR 或目的地 IP 範圍。 也可用星號 (*) 來比對所有的來源 IP。 您也可以使用預設標籤,例如 'VirtualNetwork'、'AzureLoadBalancer' 和 'Internet'。 string
destinationAddressPrefixes 目的地位址前置詞。 CIDR 或目的地 IP 範圍。 string[]
destinationApplicationSecurityGroups 指定為目的地的應用程式安全性群組。 ApplicationSecurityGroup[]
destinationPortRange 目的地埠或範圍。 介於 0 到 65535 之間的整數或範圍。 星號 '*' 也可以用來比對所有埠。 string
destinationPortRanges 目的地埠範圍。 string[]
direction 規則的方向。 此方向指定是否根據連入或連出的流量評估規則。 「Inbound」
必要) 的「輸出」 (
priority 規則的優先順序。 此值可以介於 100 到 4096 之間。 集合中每個規則的優先順序數位必須是唯一的。 優先順序號碼愈小,規則優先順序就愈高。 int (必要)
protocol 此規則適用的網路通訊協定。 "*"
「Ah」
「Esp」
「Icmp」
「Tcp」
必要) 「Udp」 (
sourceAddressPrefix CIDR 或來源 IP 範圍。 也可用星號 (*) 來比對所有的來源 IP。 您也可以使用預設標籤,例如 'VirtualNetwork'、'AzureLoadBalancer' 和 'Internet'。 如果這是輸入規則,請指定網路流量的來源。 string
sourceAddressPrefixes CIDR 或來源 IP 範圍。 string[]
sourceApplicationSecurityGroups 指定為來源的應用程式安全性群組。 ApplicationSecurityGroup[]
sourcePortRange 來源埠或範圍。 介於 0 到 65535 之間的整數或範圍。 星號 '*' 也可以用來比對所有埠。 string
sourcePortRanges 來源埠範圍。 string[]

ApplicationSecurityGroup

名稱 描述
id 資源識別碼。 string
location 資源位置。 string
properties 應用程式安全性群組的屬性。 ApplicationSecurityGroupPropertiesFormat
tags 資源標籤。 object

ApplicationSecurityGroupPropertiesFormat

此物件不包含部署期間要設定的任何屬性。 所有屬性都是 ReadOnly。

RouteTable

名稱 描述
id 資源識別碼。 string
location 資源位置。 string
properties 路由表的屬性。 RouteTablePropertiesFormat
tags 資源標籤。 object

RouteTablePropertiesFormat

名稱 描述
disableBgpRoutePropagation 是否要在該路由表上停用 BGP 所學習的路由。 True 表示停用。 bool
路由 路由表內含的路由集合。 Route[]

路由

名稱 描述
id 資源識別碼。 字串
NAME 資源群組內唯一的資源名稱。 此名稱可用來存取資源。 string
properties 路由的屬性。 RoutePropertiesFormat
類型 資源類型。 string

RoutePropertiesFormat

名稱 描述
addressPrefix 路由套用的目標 CIDR。 string
hasBgpOverride 值,指出不論 LPM 為何,此路由是否覆寫重迭的 BGP 路由。 bool
nextHopIpAddress IP 位址封包應轉送至 。 只有在下一個躍點類型為 VirtualAppliance 的路由中,才允許下一個躍點值。 string
nextHopType 要接收封包的 Azure 躍點的類型。 「網際網路」
"None"
「VirtualAppliance」
「VirtualNetworkGateway」
「VnetLocal」 (必要)

ServiceEndpointPolicy

名稱 描述
id 資源識別碼。 string
location 資源位置。 string
properties 服務端點原則的屬性。 ServiceEndpointPolicyPropertiesFormat
tags 資源標籤。 object

ServiceEndpointPolicyPropertiesFormat

名稱 描述
coNtextualServiceEndpointPolicies 關聯式服務端點原則的集合。 string[]
serviceAlias 別名,指出原則是否屬於服務 string
serviceEndpointPolicyDefinitions 服務端點原則的服務端點原則定義集合。 ServiceEndpointPolicyDefinition[]

ServiceEndpointPolicyDefinition

名稱 描述
id 資源識別碼。 字串
NAME 資源群組內唯一的資源名稱。 此名稱可用來存取資源。 string
properties 服務端點原則定義的屬性。 ServiceEndpointPolicyDefinitionPropertiesFormat
類型 資源類型。 string

ServiceEndpointPolicyDefinitionPropertiesFormat

名稱 描述
description 此規則的說明。 限制為 140 個字元。 string
服務 服務端點名稱。 string
serviceResources 服務資源清單。 string[]

ServiceEndpointPropertiesFormat

名稱 描述
位置 位置清單。 string[]
服務 端點服務的型別。 string

VirtualNetworkPeering

名稱 描述
id 資源識別碼。 字串
NAME 資源群組內唯一的資源名稱。 此名稱可用來存取資源。 string
properties 虛擬網路對等互連的屬性。 VirtualNetworkPeeringPropertiesFormat
類型 資源類型。 string

VirtualNetworkPeeringPropertiesFormat

名稱 描述
allowForwardedTraffic 遠端虛擬網路中是否允許/不允許來自本機虛擬網路中 VM 的轉送流量。 bool
allowGatewayTransit 如果閘道連結可用於遠端虛擬網路,以連結至此虛擬網路。 bool
allowVirtualNetworkAccess 區域網路空間中的 VM 是否能夠存取遠端虛擬網路空間中的 VM。 bool
doNotVerifyRemoteGateways 如果需要驗證遠端閘道的布建狀態。 bool
peeringState 虛擬網路對等互連的狀態。 「Connected」
「已中斷連線」
「已起始」
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