Design Windows Azure Application with Azure Table partitioning approach

InfoPath alternatives for form designing SharePoint

Azure table is 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 requirement we were using Azure Table for azure application.

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

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

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

Also read: Copy blobs from one storage container to another storage Container in Microsoft Azure

Facts of Azure Table Storage as it doesn’t not support count, order by, sum, group by, max, min, foreign keys etc. So understand your requirement 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.

Also read: Azure Blob Storage video streaming and performance: do you have similar requirement?

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

function Add-Entity() {

[CmdletBinding()]

param(

$table,

[String]$partitionKey,

[String]$rowKey,

[String]$name,

[String]$departmentname,

[Int]$id

)

$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

Similar SharePoint 2013 Tutorials


About Sambita Rath

I have 9 years of exprience into SharePoint implementation, architecture, Administrator, development and Training.Designing Information Architecture in SharePoint 2007, 2010,2013 and Office 365.

View all posts by Sambita Rath →

Leave a Reply