Table Service REST API

This documentation provides a comprehensive reference to the Azure Table service REST API. The Table service is a NoSQL key-attribute store that allows you to store large amounts of unstructured and semi-structured data. The Table service is accessible via anonymous HTTP or HTTPS requests. Developers can query the Table service using the REST API directly, or through Azure SDK libraries available in various languages.

Note: The Azure Table service is designed for storing entity data that requires a schemaless design and has a high volume of queries. For relational data, consider Azure SQL Database or Azure Cosmos DB's SQL API.

Table Service Operations

The Table service exposes the following operations:

Service Operations

These operations manage the Table service itself and are performed against the storage account endpoint.

Operation HTTP Method Description Resource
Get Service Stats GET Retrieves the statistics of the Table service. /
Get Service Properties GET Retrieves the properties of the Table service. /
Set Service Properties PUT Sets the properties of the Table service. /

Table Operations

These operations manage tables within the Table service.

Operation HTTP Method Description Resource
Query Tables GET Queries a collection of tables. /$​​​metadata/Tables
Create Table POST Creates a new table. /$​​​metadata/Tables
Delete Table DELETE Deletes a table. /Tables('')
Query Entities in Table GET Queries entities within a specific table. /'table-name'
Insert Entity POST Inserts a single entity into a table. /'table-name'
Batch Operation POST Performs a batch of operations. /$batch

Common Query Parameters

When querying tables or entities, you can use the following common query parameters:

Authentication and Authorization

All requests to the Azure Table service must be authenticated. The primary methods are:

For detailed information on authentication methods, refer to the Azure Storage authentication overview.

Entity Structure

An entity in the Table service is a collection of name-value pairs, similar to a row in a database table. Each entity has the following required properties:

In addition to these required properties, an entity can contain up to 62 custom properties, each with a name and a supported data type.

Supported Data Types

The Azure Table service supports the following data types:

Example: Querying Entities

The following example shows how to query entities from a table named "Products" that have a PartitionKey of "Electronics" and select only the Name and Price properties.

Request URL:
GET https://<your-storage-account-name>.table.core.windows.net/Products?$filter=PartitionKey eq 'Electronics'&$select=Name,Price HTTP/1.1
Authorization: SharedKey :
Date: Tue, 29 Sep 2023 17:48:41 GMT
Accept: application/json;odata=fullmetadata
Example Response (JSON):

{
    "value": [
        {
            "PartitionKey": "Electronics",
            "RowKey": "001",
            "Timestamp": "2023-09-29T17:48:41.1234567Z",
            "Name": "Laptop",
            "Price": 1200.50
        },
        {
            "PartitionKey": "Electronics",
            "RowKey": "002",
            "Timestamp": "2023-09-29T17:48:41.7890123Z",
            "Name": "Smartphone",
            "Price": 799.99
        }
    ]
}
            

Best Practices

Tip: For advanced scenarios and complex queries, consider using the OData query language supported by the Table service.

Get Service Stats

Retrieves the statistics of the Table service. This operation is useful for monitoring the health and performance of your storage account.

HTTP Method: GET

Resource URI: /

GET https://<your-storage-account-name>.table.core.windows.net/ HTTP/1.1
Authorization: SharedKey :
Date: Tue, 29 Sep 2023 17:50:00 GMT

Create Table

Creates a new table in the Table service. The table name must be unique within the storage account and follow specific naming conventions (alphanumeric characters and hyphens, cannot start with a number).

HTTP Method: POST

Resource URI: /Tables

Request Body:


{
    "TableName": "MyNewTable"
}
            
Important: Table names are case-insensitive.