Archive

Archive for the ‘Storage’ Category

Working with Windows Azure Storage –Download Blob files – PowerShell

March 11, 2015 Leave a comment

 

How to download blob files from the storage container.

 

1 Import-Module "C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement\Azure\Azure.psd1"
2 Import-AzurePublishSettingsFile C:\Azure\Azure_credentials_file.publishsettings
3 Get-AzureStorageAccount | select StorageAccountName
4 Set-AzureSubscription -SubscriptionName "SubscriptionName" -CurrentStorageAccountName "dbproxazurestorage"
5 Get-AzureStorageContainer  "containerstorage"  | Get-AzureStorageBlob | Get-AzureStorageBlobContent –Destination "C:\Azure\AzureStorageTableStore\blob_files_azurestorage"

 

image

 

image

 

image

Categories: Storage

Working with Windows Azure Storage –Azure Table Storage – PowerShell Part – 1

March 10, 2015 Leave a comment

Azure Table Storage is a fault-tolerant, ISO 27001 certified NoSQL key-value store. Azure Table Storage can be useful for applications that must store large amounts of non-relational data, and need additional structure for that data. Tables offer key-based access to un-schematized data at a low cost for applications with simplified data-access patterns. While Azure Table Storage stores structured data without schemas, it does not provide any way to represent relationships between the data.

Despite some notable differences, Microsoft Azure SQL Database and Azure Table Storage are both highly available managed services with a 99.9% monthly SLA.

 

 

There are couple of free tools to work with Azure Storage (Blob / Tables / Queues). The one i most of the time use is Azure Storage Explorer. There is not GUI available on

https://portal.azure.com or https://manage.windowsazure.com

 

Download the tool and configure it by clicking Add Account (You need storage account,storage account key)

 

image

image

image

By Default 2 keys columns where created which cannot be deleted or modified.More columns can be added  by click View Button

image

 

In this example i have customer deta feed files in .csv format which i am uploading it to Azure Table from my local computer. You can also use the blob storage or VPC storage for faster upload. As i am uploading it over internet the upload will be slow depending upon the link.

Click on the View button

image

select the file, pass the partition Key Name (Unique record) and RowKey (rowguid).Click  upload

 

image

 

image

 

As the data is uploading you can click refresh to see how the data is uploading.

 

We can use the monitoring section in the https://manage.windowsazure.com

 

image

 

Check Azure Tables using PowerShell

image

 

How pricing / Billing is calculated for Blob / Storage Table / Queue read this article carefully.http://blogs.msdn.com/b/windowsazurestorage/archive/2010/07/09/understanding-windows-azure-storage-billing-bandwidth-transactions-and-capacity.aspx

Categories: Storage

Working with Windows Azure Storage –Remove Storage Blob- PowerShell Part – 6

March 9, 2015 Leave a comment

 

Create the New-AzureStorageContext  and use the below command to delete the files.

 

—-Creating Azure Storage Context—

Import-Module “C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement\Azure\Azure.psd1”
Import-AzurePublishSettingsFile C:\Azure\Azure_credentials_file.publishsettings
$subscriptionName = “Subscription Name”
$storageAccountName = “Storage Account Name”
Select-AzureSubscription $subscriptionName
$storageaccountkey = get-azurestoragekey $storageAccountName | %{$_.Primary}
$destContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageaccou…

Get-AzureStorageBlob -Container containerstorage -Context $destContext

 

Get-AzureStorageBlob -Container containername -Context $destContext

 

image

Categories: Storage

Working with Windows Azure Storage –Remove Storage Account- PowerShell Part – 5

March 9, 2015 Leave a comment

 

Continuation from Part – 4 . How to Remove Azure Storage Account (Empty/In Use)

Remove-AzureStorageAccount and pass the Storage Account Name when prompted

or

Remove-AzureStorageAccount  -StorageAccountName storageaccountname

 

image

Categories: Storage

Working with Windows Azure Storage –Remove Storage Container – PowerShell Part – 4

March 9, 2015 Leave a comment

Continuation  from Part –3. Removing Azure Storage Container. While working with Azure i make sure i do not create anything which is not required/if testing, drop it once done. Azure services are paid and creating things which are not required may be chargeable (You will be billed for the services you use)

 

Lets see how can we drop the storage containers attached to the Storage Account.

 

Create the Storage Account context as explained in part-3.

Get the list of Azure Container attached to a storage Account

Get-AzureStorageContainer -Context $destContext

image

 

Drop the container

Remove-AzureStorageContainer -Name testcontainer1 -Context $destContext

image

 

 

Categories: Storage

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

March 8, 2015 Leave a comment

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

Steps

    1. Open PowerShell window and import the Azure PowerShell Module
image Import-Module “C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\
ServiceManagement\Azure\Azure.psd1”
    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.
image
image
Get-AzureSubscription

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

Working with Windows Azure Storage –New Storage Account- PowerShell Part – 2

March 8, 2015 Leave a comment

 

Automating Windows Azure Storage Account creation.. Using this you can create/drop multiple storage account for a customer or organization

Couple of things you need to keep in mind is “No use of CAPITAL letters”   for the [Storage Account Name] or [Label], the script will fail as you can see in the below images.

Know the Azure Module Location Handy if you are using Azure PowerShell Console

C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement\Azure

Know the AzurePublishSettingFile location

Import-AzurePublishSettingsFile C:\Azure\Azure_credentials_file.publishsettings

 

 

Steps to Create Azure Storage Account

  1. Open PowerShell Window and Import PowerShell ModuleImport-Module “C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement\Azure\Azure.psd1”
  2. Import the Azure Publish Setting File

    Import-AzurePublishSettingsFile C:\Azure\Azure_credentials_file.publishsettings
  3. Create the Azure Storage Account

    New-AzureStorageAccount -StorageAccountName “dbproxpstest” -Location “Southeast Asia” -Label “psstorage”
    image


    image
    image

Categories: Storage