Last updated: May 2026
Azure Storage Intermediate AZ-104 ⏱ 11 min read

Azure Table Storage

Azure Table Storage is a NoSQL key-value store that lets you store large amounts of structured, non-relational data cheaply and simply. Unlike a SQL database, there's no schema — each row can have different columns. It's not a full-featured database, but for the right workload — simple lookups, user data, configuration — it's extremely fast and cost-effective.

What you'll learn What Table Storage is · The data model — tables, entities, partition key, row key · How partitioning works · Querying with OData filters · Working with tables via CLI · Table Storage vs Cosmos DB Table API · When to use (and when not to use) Table Storage

What is Azure Table Storage?

Azure Table Storage is a NoSQL datastore that stores structured data as a collection of entities (rows) in tables. It is:

  • Schema-less — Each entity can have different properties (columns)
  • Massively scalable — Petabytes of data, millions of entities
  • Very cheap — Much cheaper than Azure SQL Database for simple lookups
  • Fast for key-based lookups — Extremely fast when you query by partition key + row key
  • Not relational — No joins, no foreign keys, limited query capability
ℹ️
NoSQL = Not Only SQL Table Storage doesn't use SQL. It's optimised for key-based lookups rather than complex queries. If you know the exact partition key and row key, retrieval is near-instant regardless of table size.

The Data Model

The hierarchy in Table Storage:

  • Storage Account — Top-level container
  • Table — A collection of entities (like a database table)
  • Entity — A single record (like a database row), up to 1 MB
  • Property — A name-value pair within an entity (like a column), up to 252 custom properties

System Properties

Every entity automatically has three system properties:

PropertyDescription
PartitionKeyGroups related entities together for scalability
RowKeyUnique identifier within a partition
TimestampLast modified time — managed automatically by Azure

Example Entity

JSON A Table Storage entity (user record)
{
  "PartitionKey": "India",
  "RowKey": "user-001",
  "Name": "Priya Sharma",
  "Email": "priya@example.com",
  "Plan": "Premium",
  "CreatedDate": "2026-01-15",
  "Timestamp": "2026-05-07T10:30:00Z"
}

Partition Key and Row Key

The combination of PartitionKey + RowKey must be unique across the entire table. Together they form the primary key.

Partition Key

Determines which partition (storage node) an entity lives on. Entities with the same partition key are stored together and can be retrieved very efficiently. Good partition key design is crucial for performance:

  • Good partition keys — CountryCode, UserId range, Date (year-month), TenantId
  • Bad partition key — A single value for all entities (creates a hot partition — all traffic goes to one node)
  • Bad partition key — Completely unique per entity (defeats the purpose of partitioning — poor scan performance)

Row Key

Uniquely identifies an entity within a partition. Combined with PartitionKey, it provides the fastest possible lookup — O(1) time complexity regardless of table size.

💡
Design Pattern For a user table: PartitionKey = country code (e.g., "IN", "US"), RowKey = user ID. This groups users by country (good for regional queries) while uniquely identifying each user within the country.

Querying with OData

Table Storage uses OData (Open Data Protocol) filter expressions for queries. Querying by PartitionKey + RowKey is fastest. Queries across all partitions (table scans) are slow and expensive for large tables.

Query TypeSpeedUse When
PartitionKey + RowKey⚡ Fastest (point lookup)You know exactly which entity you want
PartitionKey only✅ Fast (partition scan)You want all entities in a partition
PartitionKey + row range✅ GoodRange queries within a partition
Table scan (no partition key)🐢 SlowAvoid — scans all partitions
Azure CLI Query Table Storage entities
# Query by PartitionKey + RowKey (fastest)
az storage entity show \
  --table-name users \
  --partition-key "India" \
  --row-key "user-001" \
  --account-name mystorageaccount2026 \
  --auth-mode login

# Query all entities in a partition
az storage entity query \
  --table-name users \
  --filter "PartitionKey eq 'India'" \
  --account-name mystorageaccount2026 \
  --auth-mode login

# Query with multiple filters
az storage entity query \
  --table-name users \
  --filter "PartitionKey eq 'India' and Plan eq 'Premium'" \
  --account-name mystorageaccount2026 \
  --auth-mode login

Working With Tables via CLI

Azure CLI Create table and insert entities
# Create a table
az storage table create \
  --name users \
  --account-name mystorageaccount2026 \
  --auth-mode login

# Insert an entity
az storage entity insert \
  --table-name users \
  --entity PartitionKey=India RowKey=user-001 Name=PriyaSharma Email=priya@example.com Plan=Premium \
  --account-name mystorageaccount2026 \
  --auth-mode login

# Update an entity
az storage entity merge \
  --table-name users \
  --entity PartitionKey=India RowKey=user-001 Plan=Enterprise \
  --account-name mystorageaccount2026 \
  --auth-mode login

# Delete an entity
az storage entity delete \
  --table-name users \
  --partition-key India \
  --row-key user-001 \
  --account-name mystorageaccount2026 \
  --auth-mode login

Table Storage vs Cosmos DB

Azure Cosmos DB offers a Table API that is compatible with Azure Table Storage — you can migrate with minimal code changes. Cosmos DB is significantly more powerful but also more expensive:

FeatureTable StorageCosmos DB Table API
Global distributionSingle region (or paired)Multi-region, globally distributed
Latency SLANo latency SLA<10ms read, <15ms write (99th percentile)
Secondary indexesNoYes — on any property
ThroughputShared, no guaranteeDedicated, provisioned RU/s
CostVery cheapMore expensive
Best forSimple lookups, cost-sensitiveGlobal apps, latency-sensitive, complex queries

When to Use Table Storage

Good FitPoor Fit
User profile lookups by IDComplex relational queries with joins
Application configuration/settingsTransactions across multiple entities
Session state storageAd-hoc queries on non-key properties
Device telemetry by device IDGlobal low-latency requirements
Simple audit logsReporting and analytics workloads
💡
AZ-104 Exam Tip Know the Table Storage data model — tables, entities, PartitionKey, RowKey. Know that PartitionKey + RowKey is the fastest query. Know that Table Storage is schema-less NoSQL. Know when to use Table Storage vs Cosmos DB Table API.
📝 Practice Questions
Click an option to check your answer. AZ-104 style questions.
Q1. What uniquely identifies an entity in Azure Table Storage?
A PartitionKey alone
B RowKey alone
C The combination of PartitionKey + RowKey
D The Timestamp property
Q2. Which type of query is fastest in Azure Table Storage?
A A full table scan with no filter
B A query filtering only by a custom property (e.g., Email)
C A point query using both PartitionKey and RowKey
D A query filtering only by PartitionKey
Q3. What is a bad practice when choosing a PartitionKey?
A Using a country code (e.g., "India", "US") as the PartitionKey
B Using the same PartitionKey for all entities (creating a hot partition)
C Using a date range (year-month) as the PartitionKey
D Using TenantId as the PartitionKey in a multi-tenant app
Q4. What is the maximum number of custom properties an entity can have in Azure Table Storage?
A 10
B 64
C 252
D Unlimited
Q5. When should you consider migrating from Azure Table Storage to Cosmos DB Table API?
A When you need to store more than 1 TB of data
B When you need global distribution, low-latency SLAs, or secondary indexes on non-key properties
C When you need to deploy in the Central India region
D When Table Storage becomes too expensive
Comments
Disclaimer: RedKite Cloud is an independent educational resource and is not affiliated with, endorsed by, or officially connected to Microsoft Corporation. All product names, logos, and trademarks are property of their respective owners. Content is written independently for educational purposes only.