- Create a private network and affinity group
- Create storage account
At its simplest it is just:
- Create a new NetworkConfig.xml file (see below)
- 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="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/ServiceHosting/2011/07/NetworkConfiguration">
<virtualnetworkconfiguration>
<dns>
<virtualnetworksites>
<virtualnetworksite affinitygroup="MAGENIC-LAB" name="MAGENIC-LAB">
<addressspace>
<addressprefix>10.0.0.0/8</addressprefix>
</addressspace>
<subnets>
<subnet name="Subnet-1">
<addressprefix>10.0.0.0/11</addressprefix>
</subnet>
</subnets>
</virtualnetworksite>
</virtualnetworksites>
</dns>
</virtualnetworkconfiguration>
</networkconfiguration>