Azure Table storage is a data store you can use to store structured data in a non-relational way. Azure Table storage is easy to manage, and you can create multiple independent tables in a single storage account.

An Azure storage account is a widely used object in Azure that enables us to store data in different shapes. A simple storage account in Azure provides several features, such as Files, Containers, and Tables, each of which has a different purpose and different management method.

Azure Table storage features ^

Azure Table storage has the advantage that you can quickly store structured data without having to deal with the complexity of a relational database system. You can also create a huge number of independent entities in a single table. Entities represent rows in a table containing both system properties and user-defined properties like key-value pairs.

Azure Storage table structure

Azure Storage table structure

The maximum number of properties (columns) per entity (row) is 255, three of which are system properties: PartitionKey, RowKey, and Timestamp. As these come automatically by default, we can add up to 252 extra columns.

The partition key is a system property that identifies the partition in a specific table. We can have multiple rows with the same partition key. So this way, we can identify data groups in a table. This actually means that we can have different data sets in a single table with partition key support. A row key is also a system property in a table. Each row in a specific table must have a unique row key value. Unlike PartitionKey and RowKey, the Timestamp is a system-generated property that shows the row's creation time.

Multiple datasets in a single table

Multiple datasets in a single table

As shown in the above table, two data sets (sales and members) in the same table have no relation with each other. We can get the relevant data by specifying the correct partition key.

Creating Azure Storage tables ^

To be able to manage Azure Storage tables using PowerShell, you must install the required module first. To install the module, we can use the command below:

After creating a Table storage, the default address to access it is:

http://storageaccountname.table.core.windows.net/TableName

Now we can create a new storage account in which we will also create a new table. Use the following to create a new storage account:

After creating the storage account, we can create a new table in it with the command below:

Creating a new Storage table

Creating a new Storage table

This created a new table. We can now add a few rows to the table using the commands below:

Now we can list all rows and check how they appear in the table using the following command:

Listing Storage tables

Listing Storage tables

Filtering data ^

There are several ways to filter data in tables. Here are some useful examples to play with the data using some filtering methods:

Refining data using custom filters

Refining data using custom filters

Updating and deleting Table storage ^

To update an existing row, you can use the example below.

In this example, we first find the records (rows) with an age value below 50. Then we set the name values of those records as "Tuba-New." This updates the only record matching the filter with the new value.

Updating an existing row

Updating an existing row

To remove all rows in a table, you need this command:

And to delete the entire table, use this one:

As a simple NoSQL data source, Azure Storage tables are pretty useful to store non-relational data in an Azure storage account. You can easily manage the data in several ways, such as using Azure Portal, Azure Storage Explorer, and PowerShell.

Read 4sysops without ads by becoming a member!

Your question was not answered? Ask in the forum!

5+
Share
0 Comments

Leave a reply

Your email address will not be published. Required fields are marked *

*

© 4sysops 2006 - 2020

CONTACT US

Please ask IT administration questions in the forums. Any other messages are welcome.

Sending

Log in with your credentials

or    

Forgot your details?

Create Account