azure-data-tables-java – Coding skill for AI agents
Build table storage applications using the Azure Tables SDK for Java. Works with both Azure Table Storage and Cosmos DB Table API.
Install the azure-data-tables-java skill with one command
Pick the tool you use, copy the command and paste it in your terminal. The skill lands in that tool's skills folder and is ready in your next session.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/azure-data-tables-java-30dc9.tgz | tar xz -C ~/.claude/skills
Call it in Claude Code: /azure-data-tables-java – then describe the task you want done.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/azure-data-tables-java-30dc9.tgz | tar xz -C ~/.codex/skills
Call it in Codex: $azure-data-tables-java – then describe the task you want done.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/azure-data-tables-java-30dc9.tgz | tar xz -C ~/.hermes/skills
Call it in Hermes Agent: /azure-data-tables-java – then describe the task you want done.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/azure-data-tables-java-30dc9.tgz | tar xz -C ~/.deepcode/skills
Call it in DeepSeek: /azure-data-tables-java – then describe the task you want done.
SKILL.md content
Azure Tables SDK for Java
Build table storage applications using the Azure Tables SDK for Java. Works with both Azure Table Storage and Cosmos DB Table API.
Installation
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-data-tables</artifactId>
<version>12.6.0-beta.1</version>
</dependency>Client Creation
With Connection String
import com.azure.data.tables.TableServiceClient;
import com.azure.data.tables.TableServiceClientBuilder;
import com.azure.data.tables.TableClient;
TableServiceClient serviceClient = new TableServiceClientBuilder()
.connectionString("<your-connection-string>")
.buildClient();With Shared Key
import com.azure.core.credential.AzureNamedKeyCredential;
AzureNamedKeyCredential credential = new AzureNamedKeyCredential(
"<account-name>",
"<account-key>");
TableServiceClient serviceClient = new TableServiceClientBuilder()
.endpoint("<your-table-account-url>")
.credential(credential)
.buildClient();With SAS Token
TableServiceClient serviceClient = new TableServiceClientBuilder()
.endpoint("<your-table-account-url>")
.sasToken("<sas-token>")
.buildClient();With DefaultAzureCredential (Storage only)
import com.azure.identity.DefaultAzureCredentialBuilder;
TableServiceClient serviceClient = new TableServiceClientBuilder()
.endpoint("<your-table-account-url>")
.credential(new DefaultAzureCredentialBuilder().build())
.buildClient();Key Concepts
- TableServiceClient: Manage tables (create, list, delete)
- TableClient: Manage entities within a table (CRUD)
- Partition Key: Groups entities for efficient queries
- Row Key: Unique identifier within a partition
- Entity: A row with up to 252 properties (1MB Storage, 2MB Cosmos)
Core Patterns
Examples use placeholder credentials. Select a compatible released SDK version; the beta above is historical. Keep connection strings/SAS in a secret store. Confirm the account/table and deletion scope before writes. Merge/replace/upsert examples do not demonstrate ETag concurrency checks; use conditional updates where concurrent writers matter.
Create Table
// Create table (throws if exists)
TableClient tableClient = serviceClient.createTable("mytable");
// Create if not exists (no exception)
TableClient tableClient = serviceClient.createTableIfNotExists("mytable");Get Table Client
// From service client
TableClient tableClient = serviceClient.getTableClient("mytable");
// Direct construction
TableClient tableClient = new TableClientBuilder()
.connectionString("<connection-string>")
.tableName("mytable")
.buildClient();Create Entity
import com.azure.data.tables.models.TableEntity;
TableEntity entity = new TableEntity("partitionKey", "rowKey")
.addProperty("Name", "Product A")
.addProperty("Price", 29.99)
.addProperty("Quantity", 100)
.addProperty("IsAvailable", true);
tableClient.createEntity(entity);Get Entity
TableEntity entity = tableClient.getEntity("partitionKey", "rowKey");
String name = (String) entity.getProperty("Name");
Double price = (Double) entity.getProperty("Price");
System.out.printf("Product: %s, Price: %.2f%n", name, price);Update Entity
import com.azure.data.tables.models.TableEntityUpdateMode;
// Merge (update only specified properties)
TableEntity updateEntity = new TableEntity("partitionKey", "rowKey")
.addProperty("Price", 24.99);
tableClient.updateEntity(updateEntity, TableEntityUpdateMode.MERGE);
// Replace (replace entire entity)
TableEntity replaceEntity = new TableEntity("partitionKey", "rowKey")
.addProperty("Name", "Product A Updated")
.addProperty("Price", 24.99)
.addProperty("Quantity", 150);
tableClient.updateEntity(replaceEntity, TableEntityUpdateMode.REPLACE);Upsert Entity
// Insert or update (merge mode)
tableClient.upsertEntity(entity, TableEntityUpdateMode.MERGE);
// Insert or replace
tableClient.upsertEntity(entity, TableEntityUpdateMode.REPLACE);Delete Entity
tableClient.deleteEntity("partitionKey", "rowKey");List Entities
import com.azure.data.tables.models.ListEntitiesOptions;
// List all entities
for (TableEntity entity : tableClient.listEntities()) {
System.out.printf("%s - %s%n",
entity.getPartitionKey(),
entity.getRowKey());
}
// With filtering and selection
ListEntitiesOptions options = new ListEntitiesOptions()
.setFilter("PartitionKey eq 'sales'")
.setSelect(java.util.Arrays.asList("Name", "Price"));
for (TableEntity entity : tableClient.listEntities(options, null, null)) {
System.out.printf("%s: %.2f%n",
entity.getProperty("Name"),
entity.getProperty("Price"));
}Query with OData Filter
// Filter by partition key
ListEntitiesOptions options = new ListEntitiesOptions()
.setFilter("PartitionKey eq 'electronics'");
// Filter with multiple conditions
options.setFilter("PartitionKey eq 'electronics' and Price gt 100");
// Filter with comparison operators
options.setFilter("Quantity ge 10 and Quantity le 100");
// Request page size; stop iteration explicitly if only ten total results are wanted
options.setTop(10);
for (TableEntity entity : tableClient.listEntities(options, null, null)) {
System.out.println(entity.getRowKey());
}Batch Operations (Transactions)
import com.azure.data.tables.models.TableTransactionAction;
import com.azure.data.tables.models.TableTransactionActionType;
import java.util.Arrays;
// All entities must have same partition key
List<TableTransactionAction> actions = Arrays.asList(
new TableTransactionAction(
TableTransactionActionType.CREATE,
new TableEntity("batch", "row1").addProperty("Name", "Item 1")),
new TableTransactionAction(
TableTransactionActionType.CREATE,
new TableEntity("batch", "row2").addProperty("Name", "Item 2")),
new TableTransactionAction(
TableTransactionActionType.UPSERT_MERGE,
new TableEntity("batch", "row3").addProperty("Name", "Item 3"))
);
tableClient.submitTransaction(actions);List Tables
import com.azure.data.tables.models.TableItem;
import com.azure.data.tables.models.ListTablesOptions;
// List all tables
for (TableItem table : serviceClient.listTables()) {
System.out.println(table.getName());
}
// Filter tables
ListTablesOptions options = new ListTablesOptions()
.setFilter("TableName eq 'mytable'");
for (TableItem table : serviceClient.listTables(options, null, null)) {
System.out.println(table.getName());
}Delete Table
serviceClient.deleteTable("mytable");Typed Entities
TableEntity is a concrete SDK class, not an interface for a POJO to implement. Map domain values explicitly:
TableEntity product = new TableEntity("electronics", "laptop-001")
.addProperty("Name", "Laptop")
.addProperty("Price", 999.99);
tableClient.createEntity(product);Error Handling
import com.azure.data.tables.models.TableServiceException;
try {
tableClient.createEntity(entity);
} catch (TableServiceException e) {
System.out.println("Status: " + e.getResponse().getStatusCode());
System.out.println("Error: " + e.getMessage());
// 409 = Conflict (entity exists)
// 404 = Not Found
}Environment Variables
# Storage Account
AZURE_TABLES_CONNECTION_STRING=DefaultEndpointsProtocol=https;AccountName=...
AZURE_TABLES_ENDPOINT=https://<account>.table.core.windows.net
# Cosmos DB Table API
COSMOS_TABLE_ENDPOINT=https://<account>.table.cosmosdb.azure.comBest Practices
1. Partition Key Design: Choose keys that distribute load evenly
2. Batch Operations: Use transactions for atomic multi-entity updates
3. Query Optimization: Always filter by PartitionKey when possible
4. Select Projection: Only select needed properties for performance
5. Entity Size: Keep entities under 1MB (Storage) or 2MB (Cosmos)
Trigger Phrases
- "Azure Tables Java"
- "table storage SDK"
- "Cosmos DB Table API"
- "NoSQL key-value storage"
- "partition key row key"
- "table entity CRUD"
When to Use
This skill is applicable to execute the workflow or actions described in the overview.
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
Related skills
- azure-eventhub-java – Build real-time streaming applications with Azure Event Hubs SDK for Java. Use when…
- coverage – Analyze test coverage gaps. Use when user says "test coverage", "what's not tested"…
- hunt-open-redirect – Hunt Open Redirect — all types including low-impact, chained to OAuth token theft → ATO…
- modal – Modal is a serverless cloud platform for running Python on demand, including on-demand…
- azure-eventhub-rust – Azure Event Hubs SDK for Rust. Use for sending and receiving events, streaming data…
- cpo-review – /c-level-agents:cpo-review [plan] — JTBD-driven interrogation of product roadmap, PMF…
- ncats-arax – Queries the NCATS Translator ARAX production API for bounded, typed, provenance-rich…
- azure-identity-rust – Azure Identity SDK for Rust authentication. Use for DeveloperToolsCredential…