I want to create an azure storage container in an existing storage account, through powershell.I have tried the following commands:
Set-AzureSubscription -CurrentStorageAccountName "storageaccountv1" -SubscriptionId $SubscriptionId
New-AzureStorageContainer -Name $ContainerName -Permission Off
For those who know, Azure has two types of storage accounts: v1, v2. v1 accounts are the ones that are available through the http://manage.windowsazure.com/ and v2 that can be created in http://portal.azure.com/. While the command New-AzureStorageContainer is working with a storage account in v1, the command is not working for a storage account in v2. It is giving the following error:
New-AzureStorageContainer : ResourceNotFound: The storage account 'storageaccountv2' was not found.
At CreateStorageContainer.ps1:31 char:1
+ New-AzureStorageContainer -Name $ContainerName -Permission Off
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [New-AzureStorageContainer], CloudException
+ FullyQualifiedErrorId : CloudException,Microsoft.WindowsAzure.Commands.Storage.Blob.Cmdlet.NewAzureStorageContainerCommand
Can anyone tell how to create an azure storage container in v2 through powershell?