In a previous post, i talked about the CurrentStorageAccountName property of our Azure subscription.
Let’s see how create a Storage account before adding it to our subscription…
This is pretty obvious, this cmdlet creates a new storage account in your subscription.
Now, let’s check each argument and what it means
- AffinityGroup : Specifies the name of an existing affinity group in the current subscription. From what i read on Microsoft documentation, affinity groups are available for all Azure products. My guess is affinity groups are far better for performances, but for Infra, it’s not really usable for now. Keep in mind that even you create your storage account into a datacenter, they can be VERY large and you can’t guarantee the best Network speed if both servers are in physical servers which are opposite.
- Description : I think the name describes itself…
- Label : …
- Location : Specifies the Windows Azure data center location where the storage account is created. Bellow, the datacenters availables.
For a complete view about the location
Get-AzureLocation | Select Name, AvailableServices | ft -auto
Good to know: Microsoft will transfert blob and tables between datacenters in the same region (Ever heard about Disaster Recovery?), but never in another geolocalisation.. yeah laws aren’t the same in USA and Europe for example 😉
Microsoft says that you can’t specify an affinity group AND a Location.
So now, let’s start create an Affinity Group!
New-AzureAffinityGroup -Name PWRSHELL -Description "Test Affinity group" -Label "Amsterdam Datacenter" -Location "West Europe"
And the execution…
Execute this to list all your affinity groups
If you want to check on the web interface, just go to Settings > Affinity groups
Ok, so.. now our affinity group is created, let’s create a storage account.
Ok.. error… after some investigation.. it seems you can’t add CAPS in StorageAccountName, so this is the correct command line:
New-AzureStorageAccount -AffinityGroup PWRSHELL -Description "Test storage account" -Label "Amsterdam Datacenter" -StorageAccountName amsterdam01
In the web console…
Now, this is the part which got us here, how to add you storage account in the subscription !
Set-AzureSubscription -SubscriptionName "Free Trial" ` -CurrentStorageAccountName amsterdam01 # List your subscription Get-AzureSubscription
Now, we are ready to deploy our first VM, we’ll see this in a next post !
See ya !