MSDN Documentation

Azure Storage Tables Tutorials

Learn how to use Azure Table Storage to store and query large amounts of structured NoSQL data.

Getting Started

Create and Query a Table (REST API)

A step-by-step guide to creating your first table and performing basic operations using the Azure Storage REST API.

REST API NoSQL Beginner
Read Tutorial

Using the Azure Storage SDK for .NET

Learn how to interact with Azure Table Storage from your .NET applications using the official SDK.

SDK .NET C#
Read Tutorial

Advanced Topics

Partitioning and Row Keys for Performance

Understand best practices for designing your partition and row keys to optimize query performance and scalability.

Performance Design Patterns Scalability
Read Tutorial

Batch Operations and Transactions

Learn how to perform efficient batch inserts, updates, and deletes to reduce the number of requests to Table Storage.

Batch Operations Transactions Efficiency
Read Tutorial

Querying with OData Expressions

Master the use of OData syntax for powerful and flexible querying of your table data.

OData Querying Advanced
Read Tutorial

Code Examples

Example: Inserting an Entity with Azure SDK for Python

from azure.data.tables import TableServiceClient

# Replace with your actual connection string
connection_string = "YOUR_CONNECTION_STRING"
table_name = "MySampleTable"

def insert_entity():
    try:
        table_service_client = TableServiceClient.from_connection_string(connection_string)
        table_client = table_service_client.get_table_client(table_name=table_name)

        entity = {
            "PartitionKey": "user1",
            "RowKey": "profile1",
            "Name": "Alice",
            "Email": "alice@example.com"
        }
        
        table_client.upsert_entity(entity)
        print(f"Entity inserted successfully: {entity}")

    except Exception as e:
        print(f"An error occurred: {e}")

if __name__ == "__main__":
    insert_entity()
            

Example: Querying Entities with Azure SDK for Java

import com.azure.data.tables.TableClient;
import com.azure.data.tables.TableClientBuilder;
import com.azure.data.tables.models.TableEntity;
import java.util.List;

public class TableQuery {

    public static void main(String[] args) {
        // Replace with your actual connection string and table name
        String connectionString = "YOUR_CONNECTION_STRING";
        String tableName = "MySampleTable";

        try {
            TableClient tableClient = new TableClientBuilder()
                .connectionString(connectionString)
                .tableName(tableName)
                .buildClient();

            // Query for entities with PartitionKey "user1"
            String filter = "PartitionKey eq 'user1'";
            List<TableEntity> entities = tableClient.listEntities(filter, null, null).stream().toList();

            System.out.println("Found entities:");
            for (TableEntity entity : entities) {
                System.out.println(entity.getProperties());
            }

        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}