Azure Table Storage Documentation

Overview of Azure Table Storage

Azure Table Storage is a NoSQL key-attribute store that accepts authenticated calls across the internet and stores non-relational structured data. It's ideal for applications that need a flexible schema and massive scalability. Table Storage is a core component of Azure Cosmos DB, offering a fully managed, globally distributed database service.

Key Concepts

When to Use Table Storage

Data Modeling Considerations

Effective data modeling in Table Storage involves strategically choosing your PartitionKey and RowKey to optimize query performance. Consider the following:

Working with Table Storage

Creating a Table

You can create a table using the Azure SDKs for various languages (e.g., .NET, Java, Python, Node.js) or the Azure CLI.


az storage table create --name mynewtable --account-name mystorageaccount --account-key <your_storage_account_key>
            

Inserting Entities

Entities are inserted into a table as a collection of properties. Each entity requires at least a PartitionKey and a RowKey.


// Example in C#
CloudTableClient tableClient = storageAccount.CreateCloudTableClient();
CloudTable table = tableClient.GetTableReference("mytable");

MyEntity entity = new MyEntity("partition1", "row1");
entity.Timestamp = DateTime.UtcNow;
entity.Description = "Sample entity";

TableOperation insertOperation = TableOperation.Insert(entity);
table.Execute(insertOperation);
            

Querying Entities

You can query entities by specifying filter criteria. Queries that leverage the PartitionKey and RowKey are highly efficient.


# Example in Python
table_service = TableService(account_name='mystorageaccount', account_key='<your_storage_account_key>')
entities = table_service.query_entities('mytable', filter="PartitionKey eq 'partition1'")
for entity in entities:
    print(entity.RowKey, entity.Description)
            

Updating and Deleting Entities

Entities can be updated (by replacing existing ones or merging properties) or deleted using similar TableOperation objects.

Pricing and Limits

Refer to the Azure Table Storage pricing page for the latest information on costs and Azure subscription and service limits.

Note

Azure Table Storage is now part of Azure Cosmos DB. You can provision Table API accounts within Cosmos DB for advanced features like global distribution, multi-master writes, and tunable consistency.

Important

Always use HTTPS to communicate with Table Storage. Authentication is handled via Shared Key or Shared Access Signatures (SAS).

Further Reading