Skip to content
Get Started for Free

Table Storage

Azure Table Storage is a NoSQL key-value store for large volumes of semi-structured data. With the legacy Table API, data is organized into tables, partitions, and entities addressed by PartitionKey and RowKey. It is useful for lightweight metadata, lookup records, and simple operational datasets.

LocalStack for Azure lets you build and test Table Storage workflows locally using the same CLI flow as cloud environments. The supported APIs are listed in the API Coverage section.

This guide is designed for users new to Azure Table Storage and assumes basic knowledge of the Azure CLI and azlocal.

Start by enabling interception so your az commands are routed to LocalStack:

Terminal window
azlocal start_interception

The following example creates a storage account, creates a table, and performs basic entity operations.

Create a resource group for the storage resources:

Terminal window
az group create --name rg-table-legacy-demo --location westeurope
Output
{
"name": "rg-table-legacy-demo",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-table-legacy-demo",
"location": "westeurope",
"properties": {
"provisioningState": "Succeeded"
},
...
}

Create a storage account that will host the table service:

Terminal window
az storage account create \
--name stordoc88acct \
--resource-group rg-table-legacy-demo \
--location westeurope \
--sku Standard_LRS \
--kind StorageV2
Output
{
"name": "stordoc88acct",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-table-legacy-demo/providers/Microsoft.Storage/storageAccounts/stordoc88acct",
"location": "westeurope",
"kind": "StorageV2",
"provisioningState": "Succeeded",
"primaryEndpoints": {
"table": "https://stordoc88accttable.localhost.localstack.cloud:4566",
...
},
...
}

Get the storage account connection string used for data-plane operations:

Terminal window
CONNECTION_STRING=$(az storage account show-connection-string \
--name stordoc88acct \
--resource-group rg-table-legacy-demo \
--query connectionString -o tsv)

Create a table:

Terminal window
az storage table create --name legacytable --connection-string "$CONNECTION_STRING"
Output
{
"created": true
}

Check whether the table exists:

Terminal window
az storage table exists --name legacytable --connection-string "$CONNECTION_STRING"
Output
{
"exists": true
}

Insert an entity into the table:

Terminal window
az storage entity insert \
--connection-string "$CONNECTION_STRING" \
--table-name legacytable \
--entity PartitionKey=demo RowKey=1 name=Alice score=100
Output
{
"content": {
"PartitionKey": "demo",
"RowKey": "1",
"name": "Alice",
"score": 100,
...
},
"etag": "W/\"datetime'2026-02-27T11%3A37%3A25.7298901Z'\"",
...
}

Get the inserted entity:

Terminal window
az storage entity show \
--connection-string "$CONNECTION_STRING" \
--table-name legacytable \
--partition-key demo \
--row-key 1
Output
{
"PartitionKey": "demo",
"RowKey": "1",
"name": "Alice",
"score": 100,
...
}

Query entities by partition key:

Terminal window
az storage entity query \
--connection-string "$CONNECTION_STRING" \
--table-name legacytable \
--filter "PartitionKey eq 'demo'"
Output
{
"items": [
{
"PartitionKey": "demo",
"RowKey": "1",
"name": "Alice",
"score": 100,
...
}
],
"nextMarker": {}
}

Update the entity with a merge operation:

Terminal window
az storage entity merge \
--connection-string "$CONNECTION_STRING" \
--table-name legacytable \
--entity PartitionKey=demo RowKey=1 score=101
Output
{
"etag": "W/\"datetime'2026-02-27T11%3A37%3A27.3795415Z'\"",
...
}

Delete the entity and verify the table is empty:

Terminal window
az storage entity delete \
--connection-string "$CONNECTION_STRING" \
--table-name legacytable \
--partition-key demo \
--row-key 1
az storage entity query \
--connection-string "$CONNECTION_STRING" \
--table-name legacytable
Output
{
"deleted": null
}
{
"items": [],
"nextMarker": {}
}
OperationImplemented
Page 1 of 0
Was this page helpful?