Design Windows Azure Application with Azure Table partitioning approach

This Azure tutorial, we will discuss how to Design Windows Azure Application with Azure Table partitioning.

The azure table is a No-SQL database. It’s cheap, perform well and easy integration if you are looking store large amount of structured data.

For one of the requirements, we were using Azure Table for an Azure application.

The application had many departments and each department will have a different data structure.

At a time user will be part of only one department he belongs to. So we implemented Azure Table partitioned by the department.

This will ensure the user can efficiently query records related to their department.

Facts of Azure Table Storage as it doesn’t support count, order by, sum, group by, max, min, foreign keys etc. To understand your requirements before using Azure Table.

PartitionKey and RowKey uniquely identify every entity within a table.

We can make the things done in C# or PowerShell script.

I will be providing a PowerShell script to achieve the same. You can create a CSV file and maintain the input data to loop and enter the data to Azure Table.

function Add-Entity() {
$entity = New-Object -TypeName Microsoft.WindowsAzure.Storage.Table.DynamicTableEntity -ArgumentList $partitionKey, $rowKey
$entity.Properties.Add(“Name”, $name)
$entity.Properties.Add(“Name”, $departmentname)
$entity.Properties.Add(“ID”, $id)
$result = $table.CloudTable.Execute([Microsoft.WindowsAzure.Storage.Table.TableOperation]::Insert($entity))

$StorageAccountName = “samstorage”
$StorageAccountKey = Get-AzureStorageKey -StorageAccountName $StorageAccountName
$Ctx = New-AzureStorageContext $StorageAccountName -StorageAccountKey $StorageAccountKey.Primary
$TableName = “DepartmentData”
$table = Get-AzureStorageTable –Name $TableName -Context $Ctx -ErrorAction Ignore
if ($table -eq $null)
$table = New-AzureStorageTable –Name $TableName -Context $Ctx

#Add multiple entities to a table.You can also loop it provided by input CSV
Add-Entity -Table $table -PartitionKey PartitionHR -RowKey Row1 -Name Sam -Id 1
Add-Entity -Table $table -PartitionKey PartitionHR -RowKey Row2 -Name Ram -Id 2
Add-Entity -Table $table -PartitionKey PartitionFinance -RowKey Row1 -Name Kaka -Id 3
Add-Entity -Table $table -PartitionKey Partition2 -RowKey Row2 -Name Nana -Id 4

You may like following Azure tutorials:

Here we learned how to design Windows Azure Application with Azure Table partitioning approach.

Donwload Hub site pdf

Download SharePoint Online Tutorial PDF FREE!

Get update on Webinars, video tutorials, training courses etc.