次の方法で共有


The Case of the Angry Network

A customer contacted us with an interesting case.

When they logged on to their management portal, their Virtual Networks resource manager was in an error state as shown below:

image

A quick communication with support shed some light into a known problem: white spaces.

Turns out that there is an unfortunate “feature” in the portal, which allows you to create local networks or DNS servers with a space in their names.

This will cause Azure to display the error icon on the Networks option on the left navigation bar. When you click on Networks, Azure will not update the screen and the UI for network management will not be available.

Although inconvenient, this is not too problematic, with a simple solution.

Since the virtual networks configuration is not available from the portal, we can resort to PowerShell to solve the problem.

We first export the configuration using the command Get-AzureVNetConfig as follows (ensure that the path for the file exists):

   Get-AzureVNetConfig –ExportToFile C:\Temp\AzureVNetConfig.netcfg

Open the file created by PowerShell in notepad:

  NotePad C:\Temp\AzureVNetConfig.netcfg

The file will look like:

Technorati Tags: English,Azure,Virtual Networking,IaaS

<?xml version="1.0" encoding="utf-8"?>
  <NetworkConfiguration xmlns:xsd="https://www.w3.org/2001/XMLSchema" xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xmlns="https://schemas.microsoft.com/ServiceHosting/2011/07/NetworkConfiguration">
    <VirtualNetworkConfiguration>
      <Dns>
        <DnsServers>
          <DnsServer name="Contoso" IPAddress="10.0.0.4" />
          <DnsServer name="Fabrikam" IPAddress="10.0.0.6" />
        </DnsServers>
      </Dns>
      <LocalNetworkSites>
        <LocalNetworkSite name="My Test">
          <AddressSpace>
            <AddressPrefix>10.1.0.1/8</AddressPrefix>
          </AddressSpace>
          <VPNGatewayAddress>10.0.0.1</VPNGatewayAddress>
        </LocalNetworkSite>
        .
        .
        .

Notice the highlighted name. In my case, I had created a local network called “My Test”.

Remove the space or rename the local network (or DNS server) with a valid name and save the file. Import the network configuration using the following command:

   Set-AzureVNetConfig –ConfigurationPath C:\Temp\AzureVNetConfig.netcfg

Go back to the management portal and you will see that the Network option is back to its sweet normal self.