Azure Storage Table REST API

This document provides detailed information about the Azure Storage Table REST API. The Table service is a NoSQL key-attribute store that you can use to store and query vast amounts of structured, non-relational data. The Table service is a schema-less store, meaning that it doesn't enforce the structure of your data. Each entity in a table has a set of properties, and each property is a simple name-value pair.

Key Concepts

  • Tables: A collection of entities.
  • Entities: A set of properties, analogous to a row in a database.
  • Properties: A name-value pair, where the name is a string and the value can be one of the supported primitive data types.
  • PartitionKey: A string that determines the partition in which an entity resides.
  • RowKey: A string that uniquely identifies an entity within a partition.

API Reference

GET /Tables

Lists all tables for the specified storage account.

Query Parameters

Name Description Required
format Specifies the response format. Supported values are application/json and application/xml. No
marker A string value that identifies the next page of results to retrieve. No
maxresults An integer value that indicates the maximum number of results to return. No
filter Allows clients to filter results. No

Response Headers

Name Description
x-ms-continuation-next-marker If the result set is truncated, this header contains a marker value that retrieves the next page of results.

Response Body (JSON example)


{
  "odata.metadata": "https://myaccount.table.core.windows.net/$metadata#Tables",
  "value": [
    {
      "TableName": "Products"
    },
    {
      "TableName": "Customers"
    }
  ]
}
                            

POST /Tables

Creates a new table in the specified storage account.

Request Body (JSON example)


{
  "TableName": "NewOrders"
}
                            

Response Headers

Name Description
Location The URI of the created table.

GET /Tables('table-name')

Retrieves the specified table.

Query Parameters

Name Description Required
format Specifies the response format. Supported values are application/json and application/xml. No

Response Body (JSON example)


{
  "TableName": "Customers"
}
                            

DELETE /Tables('table-name')

Deletes the specified table and all entities within it.

Response Headers

Name Description
x-ms-request-id The value that corresponds to the value you specified for the x-ms-client-request-id header.

Entities Operations

POST /table-name()

Inserts a new entity into the specified table.

Request Body (JSON example)


{
  "PartitionKey": "CustomerA",
  "RowKey": "12345",
  "Email": "customer.a@example.com",
  "PhoneNumber": "555-1234",
  "Address": "123 Main St"
}
                            

Response Headers

Name Description
Location The URI of the inserted entity.

GET /table-name()

Queries entities in the specified table.

Query Parameters

Name Description Required
$filter OData filter expression to retrieve specific entities. No
$select Comma-separated list of property names to return. No
marker A string value that identifies the next page of results to retrieve. No
maxresults An integer value that indicates the maximum number of results to return. No

Response Body (JSON example)


{
  "odata.metadata": "https://myaccount.table.core.windows.net/Customers/$metadata#Customers",
  "value": [
    {
      "PartitionKey": "CustomerA",
      "RowKey": "12345",
      "Timestamp": "2023-10-27T10:00:00Z",
      "Email": "customer.a@example.com",
      "PhoneNumber": "555-1234",
      "Address": "123 Main St"
    },
    {
      "PartitionKey": "CustomerB",
      "RowKey": "67890",
      "Timestamp": "2023-10-27T10:05:00Z",
      "Email": "customer.b@example.com",
      "PhoneNumber": "555-5678",
      "Address": "456 Oak Ave"
    }
  ]
}
                            

GET /table-name(PartitionKey='partition-key',RowKey='row-key')

Retrieves a specific entity.

Query Parameters

Name Description Required
$select Comma-separated list of property names to return. No

Response Body (JSON example)


{
  "PartitionKey": "CustomerA",
  "RowKey": "12345",
  "Timestamp": "2023-10-27T10:00:00Z",
  "Email": "customer.a@example.com",
  "PhoneNumber": "555-1234",
  "Address": "123 Main St"
}
                            

MERGE /table-name(PartitionKey='partition-key',RowKey='row-key')

Merges an existing entity with a set of updated properties. Properties not included in the request body are not modified.

Request Body (JSON example)


{
  "Email": "updated.email@example.com",
  "PhoneNumber": "555-9999"
}
                            

UPDATE /table-name(PartitionKey='partition-key',RowKey='row-key')

Replaces an existing entity with a new set of properties. All properties of the entity are replaced.

Request Body (JSON example)


{
  "PartitionKey": "CustomerA",
  "RowKey": "12345",
  "Email": "fully.updated@example.com",
  "NewProperty": "some value"
}
                            

DELETE /table-name(PartitionKey='partition-key',RowKey='row-key')

Deletes the specified entity.