Buy Me a Coffee

Buy Me a Coffee!

Monday, May 5, 2014

Making mountains out of molehills with Azure

Ok, so to get the first two listed items taken care of is quite easy to do, but hard to do correctly.  Let's take a look at them:

  1. Create a private network and affinity group
  2. Create storage account

At its simplest it is just:

  1. Create a new NetworkConfig.xml file (see below)
  2. Run the following three commands:

     New-AzureAffinityGroup -Name "MAGENIC-LAB" -Location "East US"
     Set-AzureVNetConfig -ConfigurationPath "NetworkConfig.xml"
     New-AzureStorageAccount -StorageAccountName "mageniclab" -Location "East US"

Which works great unless you have a name collision.  Next time I will add some logic to handle name collisions and set up some conventions around the names.

Network Config.xml
<networkconfiguration xmlns:xsd="" xmlns:xsi="" xmlns="">
      <virtualnetworksite affinitygroup="MAGENIC-LAB" name="MAGENIC-LAB">
          <subnet name="Subnet-1">