Azure Tables SDK for Python
使用 Python 构建 Azure Tables 集成
开发者需要有关在 Python 应用程序中集成 Azure Tables NoSQL 存储的指导。本技能提供关于使用 Azure Data Tables SDK 进行认证、实体操作、查询和批量事务的全面文档。
下载技能 ZIP
在 Claude 中上传
前往 设置 → 功能 → 技能 → 上传技能
开启并开始使用
测试它
正在使用“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. 此模式可防止注入并优化分区范围查询
安全审计
安全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.
质量评分
你能构建什么
构建云应用的 Python 开发者
从事 Azure 云应用开发的 Python 开发者需要添加 NoSQL 数据存储。本技能指导他们使用正确的认证和最佳实践集成 Azure Tables SDK。
数据工程师实现缓存层
数据工程师需要一个快速的键值存储来缓存或存储会话数据。本技能帮助他们使用正确的分区键设计设置 Azure Tables,以实现最优查询性能。
DevOps 工程师设置基础设施
DevOps 工程师需要文档来帮助开发团队集成 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 以下以获得最佳性能