Specifying Name Resolution Parameters in the Service Configuration File
Updated: December 6, 2013
You can specify a DNS server or servers when you create or edit a Service Configuration file. The DnsServers element is an optional element under the parent NetworkConfiguration element in the Service Configuration file. Settings in the Service Configuration file take precedence over settings contained in the Network Configuration file. When specifying these values, be aware that DnsServer name is used only as a descriptive identifier. The IP address must be a valid IPv4 address for the DNS server that you want to use.
For more information, see Windows Azure NetworkConfiguration Schema (.cscfg).
<DnsServers> <DnsServer name="ID1" IPAddress="IPAddress1" /> <DnsServer name="ID2" IPAddress="IPAddress2" /> <DnsServer name="ID3" IPAddress="IPAddress3" /> </DnsServers>
In order to allow your role instances to be referenced by hostname, you must set the value for the hostname in the Service Configuration file for each role instance. Although vmName is optional in the Service Configuration file, if you do not include it, your role instances cannot be referred to by hostname in DNS.
The value that defines the hostname is vmName=“<vm-name>”. This value becomes the root of the hostname. The value is then translated into the hostname by appending the instance number to the vmName. For example, if the vmName is “MyApp”, vmName=“MyApp”, the hostnames would be “MyApp01”, “MyApp02”, “MyApp03” etc.
For more information about configuring a Windows Azure service, see Windows Azure Service Configuration Schema (.cscfg) and Updating a Windows Azure Service.
<Role name="<role-name>" vmName=“<vm-name>”>