技能 Azure Tables SDK for Python
📦

Azure Tables SDK for Python

安全

使用 Python 构建 Azure Tables 集成

开发者需要有关在 Python 应用程序中集成 Azure Tables NoSQL 存储的指导。本技能提供关于使用 Azure Data Tables SDK 进行认证、实体操作、查询和批量事务的全面文档。

支持: Claude Codex Code(CC)
🥉 73 青铜
1

下载技能 ZIP

2

在 Claude 中上传

前往 设置 → 功能 → 技能 → 上传技能

3

开启并开始使用

测试它

正在使用“Azure Tables SDK for Python”。 How do I authenticate to Azure Tables using DefaultAzureCredential?

预期结果:

  • 使用 DefaultAzureCredential 进行 Azure 身份验证:
  • 1. 安装 azure-identity 包
  • 2. 从 azure.identity 导入 DefaultAzureCredential
  • 3. 将凭据传递给 TableServiceClient 或 TableClient
  • 这支持托管标识、服务主体和通过 Azure CLI 进行本地开发

正在使用“Azure Tables SDK for Python”。 Create a Python function that queries Azure Table for orders in a specific partition

预期结果:

  • 使用 query_entities() 按 PartitionKey 查询实体:
  • 1. 使用 query_filter='PartitionKey eq @pk' 进行分区查询
  • 2. 传递 parameters={'pk': 'your-partition-value'} 以进行安全过滤
  • 3. 此模式可防止注入并优化分区范围查询

安全审计

安全
v1 • 2/24/2026

Documentation-only skill containing SKILL.md file with Azure Tables SDK usage examples. Static analysis scanned 0 files (0 lines) and found no security issues. This skill provides reference documentation and code examples only - it has no executable code, scripts, or network capabilities. Pure knowledge-base skill for AI-assisted development.

0
已扫描文件
0
分析行数
0
发现项
1
审计总数
未发现安全问题
审计者: claude

质量评分

38
架构
100
可维护性
87
内容
50
社区
100
安全
83
规范符合性

你能构建什么

构建云应用的 Python 开发者

从事 Azure 云应用开发的 Python 开发者需要添加 NoSQL 数据存储。本技能指导他们使用正确的认证和最佳实践集成 Azure Tables SDK。

数据工程师实现缓存层

数据工程师需要一个快速的键值存储来缓存或存储会话数据。本技能帮助他们使用正确的分区键设计设置 Azure Tables,以实现最优查询性能。

DevOps 工程师设置基础设施

DevOps 工程师需要文档来帮助开发团队集成 Azure Tables。本技能提供他们可以分享或用作参考文档的代码示例。

试试这些提示

Azure Tables 入门
How do I set up authentication with DefaultAzureCredential for Azure Tables SDK in Python?
实体操作基础
Show me how to create, read, update, and delete entities in Azure Tables using Python SDK.
使用过滤器查询
How do I query entities with filters in Azure Tables? I need to filter by PartitionKey and also by a property like price.
批量事务
What is the correct way to perform batch operations in Azure Tables? I need to insert multiple entities in the same partition.

最佳实践

  • 尽可能在单个分区内查询 - 跨分区查询速度更慢且成本更高
  • 使用参数化查询而不是字符串连接,以防止注入攻击
  • 根据查询模式设计分区键,确保数据均匀分布

避免

  • 不要频繁执行跨分区查询 - 这会导致高延迟和高成本
  • 避免使用过大的实体 - Azure Tables 每个实体有 1MB 限制
  • 不要使用过长的 RowKey 值 - 保持其在 1KB 以下以获得最佳性能

常见问题

TableServiceClient 和 TableClient 有什么区别?
TableServiceClient 管理表 - 创建、删除、列出表。TableClient 处理特定表内的实体 - CRUD 操作和查询。
如何处理 Azure Tables 中的实体键?
每个实体都需要 PartitionKey 和 RowKey。两者共同形成唯一标识符。PartitionKey 将相关实体分组以实现高效查询。
我可以将 Azure Tables 与 Cosmos DB 一起使用吗?
是的,Azure Tables SDK 同时适用于 Azure Storage Tables 和 Cosmos DB Table API。为每个服务使用相应的端点 URL。
Azure Tables 中的批量操作如何工作?
批量操作使用 submit_transaction() 和操作列表。所有实体必须具有相同的 PartitionKey。每个批处理最多 100 个操作。
Azure Tables 支持哪些数据类型?
Azure Tables 支持:str、int、float、bool、datetime、bytes 和 UUID。复杂类型必须序列化为字符串。
如何保护我的 Azure Tables 查询?
使用 parameters 参数进行参数化查询,而不是字符串格式化。这可以防止 OData 注入攻击。

开发者详情

文件结构

📄 SKILL.md