Partager via


Azure Virtual Network Configuration Schema

 

The VirtualNetworkConfiguration element of the Virtual Network configuration schema specifies Virtual Network configuration settings.

VirtualNetworkConfiguration Element

The following example shows the VirtualNetworkConfiguration element and its child elements.

Important

The example below shows the VirtualNetworkSite element with both the AffinityGroup attribute and the Location attribute. Only one can be defined for a virtual network site. Either a virtual network site can be in an affinity group, or located in a specified location. It is recommended that Location be used whenever possible.

<NetworkConfiguration xmlns="https://schemas.microsoft.com/ServiceHosting/2011/07/NetworkConfiguration">
  <VirtualNetworkConfiguration>
    <Dns>
      <DnsServers>
        <DnsServer name="" IPAddress=""/>
      </DnsServers>
    </Dns>
    <LocalNetworkSites>
      <LocalNetworkSite name="">
        <VPNGatewayAddress>gateway-address</VPNGatewayAddress>
        <AddressSpace>
          <AddressPrefix>address-prefix</AddressPrefix>
        </AddressSpace>
      </LocalNetworkSite>
    </LocalNetworkSites>
    <VirtualNetworkSites>
      <VirtualNetworkSite name="" AffinityGroup="" Location="">
        <Gateway profile="">
          <VPNClientAddressPool>
            <AddressPrefix>address-prefix</AddressPrefix>
          </VPNClientAddressPool>
          <ConnectionsToLocalNetwork>
            <LocalNetworkSiteRef name=""/>
              <Connection type=""/>
            </LocalNetworkSiteRef>
          </ConnectionsToLocalNetwork>
        </Gateway>
        <DnsServersRef>
          <DnsServerRef name=""/>
        </DnsServersRef>
        <Subnets>
          <Subnet name="">
            <AddressPrefix>address-prefix</AddressPrefix>
          </Subnet>
        </Subnets>
        <AddressSpace>
          <AddressPrefix>address-prefix</AddressPrefix>
        </AddressSpace>
      </VirtualNetworkSite>
    </VirtualNetworkSites>
  </VirtualNetworkConfiguration>
</NetworkConfiguration>

The following table describes the child elements of the NetworkConfiguration element.

Element

Description

DnsServer

Optional. Specifies a DNS server for the Virtual Network. You can specify up to 9 DNS servers. The name of the DNS server is defined as a string for the name attribute. The IP address of the DNS server is defined by a string for the IPAddress attribute. If you do not specify a DNS server, Azure will default to using its own DNS service.

DNS server names must be uniquely identifiable within the subscription. After the DNS servers have been specified and the network configuration file has been uploaded to Azure, you cannot update or add DNS server names or IP addresses once a virtual machine or cloud service has been deployed to the Virtual Network, regardless of whether or not the service is running.

The DNS server IP addresses can be changed at any time. Changing DNS server settings requires all Virtual Machines in the virtual networks that are impacted to be rebooted. Name resolution may not work if the Virtual Machines do not pick up the updates.

LocalNetworkSite

Optional. Specifies information about local network sites that are associated with the virtual network. You can specify up to 10 local network sites. The name of the local network site is defined by a string for the name attribute.

VPNGatewayAddress

Optional. Specifies the IPsec VPN tunnels between virtual networks and on-premises local network sites. To use this element, you must configure a VPN gateway appliance on your local premises (either software or hardware) that can be reached by a public IP address. You can specify only 1 public IPv4 address per local network site. For more information about supported VPN devices, see About VPN Devices for Virtual Network.

AddressPrefix (LocalNetworkSite)

Optional. Specifies the address space that is used for the local network site. This is the address space of the on-premises network. The IP address ranges that you specify must not overlap with the IP address ranges of any other local network sites or virtual network sites. Specify the public IPv4 address space per local network site, using CIDR notation.

VirtualNetworkSite

Required. Specifies the definition of a virtual network site. You can define up to 10 virtual network sites per subscription. The name of the virtual network site is defined by a string for the name attribute. To specify a virtual network, you must also know the affinity group or region that you want the virtual network sites to be associated with. When using an affinity group, the affinity group must be created prior to uploading this configuration file. The affinity group is defined by a string for the AffinityGroup attribute. The region is defined by a string for the Location attribute. AffinityGroup or Location can be defined, but not both.

Gateway

Optional. Specifies the gateway that is used for cross-premises connectivity from the virtual network. The size of the gateway is defined by a string for profile attribute. The profile value must be Small.

AddressPrefix

Optional. Specifies the address space that is used for VPN clients. Address prefixes specified in this section must be non-overlapping with other address prefixes and cannot be a subset of the virtual network’s address space. You can specify more than one address prefix.

LocalNetworkSiteRef

Optional. Specifies the external network sites to connect to. Up to 10 reference sites can be added. reference site is allowed. Any site that you reference must be defined in the LocalNetworkSite element of this configuration file. The name of the site is defined by a string for the name attribute.

Connection

Optional. Specifies the type of local network site. The type of connection is defined by a string for the type attribute.

VirtualNetworkSiteRef

Optional. Specifies a virtual network that can communicate with the virtual network site. Any Virtual Network that you reference must be defined in the VirtualNetworkSite element of this configuration file.

DnsServerRef

Required. Specifies the DNS servers that are used for name resolution in the virtual network. You must reference the DNS servers that are specified in Dns. The name of the DNS server is defined by a string for the name attribute. Azure will be set as the default DNS service for the virtual network if you do not specify any DNS servers. If you choose not to specify DNS servers in this section, name resolution will not work across a VPN link. You can specify up to 9 DNS servers.

Subnet

Required. Specifies the subnets within the address space of the virtual network sites. The name of the subnet is defined by a string for the name attribute. You can define multiple subnets for each virtual network site that you create. The IP addresses of the subnets you specify must be fully contained within the IP address range for the Virtual Network it resides in. Subnet address spaces must not overlap within the Virtual Network.

AddressPrefix (Subnet)

Required. Specifies the address space that is used for subnets. Address prefixes specified in this section must be non-overlapping with other address prefixes and cannot be a subset of the virtual network’s address space. You can specify more than one address prefix.

AddressPrefix (VirtualNetworkSite)

Required. Specifies the address space that is used for virtual network sites. Address prefixes specified in this section must be non-overlapping with other address prefixes and cannot be a subset of the virtual network’s address space. You can specify more than one address prefix.

See Also

Virtual Network Overview