I was trying to create an Azure Storage Account using PowerShell cmdlets over the weekend and was welcomed by bunch of errors.
PS C:\> New-AzureStorageAccount -ResourceGroupName “TestAvaGRP” -Name “teststorage” -Type “Standard_LRS” -Location “East
New-AzureStorageAccount : StorageAccountAlreadyTaken: The storage account named teststorage is already taken.
At line:1 char:1
+ New-AzureStorageAccount -ResourceGroupName “TestAvaGRP” -Name “teststorage” -Typ …
+ CategoryInfo : CloseError: (:) [New-AzureStorageAccount], CloudException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Management.Storage.NewAzureStorageAccountCommand
I quickly checked the Syntax of New-AzureStorageAccount from the following MSDN link https://msdn.microsoft.com/en-us/library/azure/dn495115.aspx and it says “The New-AzureStorageAccount cmdlet creates an account that provides access to Azure storage services. A storage account is a globally unique resource within the storage system. The account is the parent namespace for the Blob, Queue, and Table services.”
In simple language, this means, if some one else who is not related to your subscription has created the storage account with same name – the command will fail to create the storage account. Your storage account name should be unique because New-AzureStorageAccount runs in global context and not under your subscription. Hopefully Microsoft will get around this as it might cause naming standards issue when creating accounts (if someone else has created the similar storage account else where with same name).