Home > Storage > Working with Windows Azure Storage –Create Storage Container – PowerShell Part – 3

Working with Windows Azure Storage –Create Storage Container – PowerShell Part – 3

Continuation  from Part –2. A storage account can contain zero or more containers. A container contains properties, metadata, and zero or more blobs. A blob is any single entity comprised of binary data, properties, and metadata.


Lets create a storage container under storage account we created in Part-2


    1. Open PowerShell window and import the Azure PowerShell Module
image Import-Module “C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\
    1. Import the Credentials Publishing settings
image Import-AzurePublishSettingsFile C:\Azure\Azure_credentials_file.publishsettings
    1. Get details of Azure Storage Accounts
image Get-AzureStorageAccount | SELECT StorageAccountName,Location,EndPoints |Format-Custom
    1. Create the container under any of the account listed in step3. To create the container you require subscription Name,StorageAccountName,storageaccountkey to create AzureStorageContext.

PS C:\> $subscriptionName = “subscription name”
PS C:\> $storageAccountName = “storage account name”
PS C:\> Select-AzureSubscription $subscriptionName
PS C:\> $storageaccountkey = get-azurestoragekey $storageAccountName | %{$_.Primary}
PS C:\> $destContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageaccountkey
PS C:\> New-AzureStorageContainer testcontainer1 -Permission Off -Context $destContext

Categories: Storage
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: