Configure a Virtual Network Using a Network Configuration File
Updated: November 11, 2014
To configure your virtual network, you can use the Management Portal wizard or you can create and import a network configuration file. Azure uses the network configuration file to define your virtual network settings.
You might prefer to use the Management Portal wizard to initially create your virtual network configuration, and then make subsequent changes by direct edits to the configuration file. For example, if you are configuring multiple virtual networks for separate subscriptions, you may want to first create a network configuration file using the Management Portal wizard. You can then export the file to use as a template, edit it to specify different settings, and then import the file back into the Management Portal. This can be an efficient way to create multiple virtual networks when you have more than one subscription. Or, if you want to make changes to your network configuration settings before deploying cloud services or virtual machines to the network, you can export the file, edit it, and then import it back to Azure.
After your virtual network has been configured, you can deploy virtual machines or cloud services. When you deploy virtual machines, they will receive the settings that you specified for the virtual network. When you deploy cloud services, you will additionally use a service configuration file. The service configuration file specifies the number of role instances to deploy for each role in the service, the values of any configuration settings, and the thumbprints for any certificates associated with a role. This file contains other settings that are relevant to Virtual Network.
In order to author a network configuration file, you can create a virtual network by using the Management Portal, export the network configuration file that is created by the wizard, and edit that file in order to create a new virtual network. Alternatively, you can download and edit a virtual network configuration file sample.
For more information about the specific settings contained in the network configuration file, see Azure Virtual Network Configuration Schema.
Some of the Virtual Network settings that you can specify in the network configuration file are:
The IP addresses of DNS servers to use for name resolution.
The IP address space and IP subnet definitions for virtual networks from which cloud service and virtual machines will be deployed.
Your local network site name and address space. Local Network site refers to your on-premises network.
Your VPN Gateway IP Address.
The Location (region) that you want to associate with your virtual network OR the affinity group that you want to associate the VNet with. In most cases, you’ll want to use the region (Location).
To edit the network configuration file, you can simply open the file, make the appropriate changes, and save them. You can use any xml editor to make changes to the network configuration file. You should closely follow the guidance for network configuration file schema settings. If you make changes to values in the file that are not compatible with the settings guidelines, your virtual network may not be configured in the way that you intended.
For specific details about the elements and setting guidelines, see Azure Virtual Network Configuration Schema.
The NetworkConfiguration elements of the service configuration file can be used to deploy cloud services into a virtual network that was previously defined in a network configuration file. These settings are optional for cloud services. If you don’t specify settings in the Virtual Network elements section, the cloud service will not be deployed into a virtual network.
For more information about the service configuration file settings, see NetworkConfiguration Schema.
Some of the Network Configuration settings that you can specify in the service configuration file are:
The DNS servers to use for name resolution
The Virtual Network site name
The address space and subnet for the cloud service