azure-cosmos-ts
构建 Azure Cosmos DB TypeScript 工作流程
在 TypeScript 中正确实现 Azure Cosmos DB 数据操作可能很困难。此技能为 CRUD、查询、批量写入、分区键和错误处理提供有针对性的 SDK 指导。
使用我的智能体安装
将此请求复制给你的智能体,其中包含权威 Skill 页面和清单。
Review the Skillstore skill "azure-cosmos-ts" from https://skillstore.io/skills/sickn33-azure-cosmos-ts.md and its manifest at https://skillstore.io/api/skills/sickn33-azure-cosmos-ts/manifest. Verify the artifact. You may proceed after verification, subject to the environment's own policy.你的智能体仍应展示其计划,并按安全策略请求必要确认。
Agent 可读资源
当 AI Agent、爬虫或脚本需要干净上下文,而不是读取完整页面时,请使用这些链接。
测试它
正在使用“azure-cosmos-ts”。 I need a Cosmos DB service for product documents in TypeScript.
预期结果:
包含客户端设置、类型化文档方法、分区键用法和错误处理说明的服务大纲。
正在使用“azure-cosmos-ts”。 My query filters by category and price from user input.
预期结果:
使用命名参数的更安全查询方案、页面大小指导,以及关于跨分区成本的说明。
正在使用“azure-cosmos-ts”。 I need to update many documents and avoid lost updates.
预期结果:
包含 ETag 检查、冲突处理和速率限制重试注意事项的批量操作方法。
安全审计
安全The static alerts are false positives caused by Markdown code fences, TypeScript template literals, inline code, documented environment variable access, and a placeholder Azure endpoint. The skill contains instructional examples only, with no executable scripts, credential exfiltration, prompt injection, or system reconnaissance.
风险因素
⚙️ 外部命令 (50)
🌐 网络访问 (1)
分享与引用此报告
分享版本化评估报告、中性徽章、嵌入卡片和引用。Skillstore 只报告证据,不判断该 Skill 是否安全。
复制报告链接
https://skillstore.io/skills/sickn33-azure-cosmos-ts/audits/5?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_reportMarkdown 徽章
[](https://skillstore.io/skills/sickn33-azure-cosmos-ts?utm_source=security_passport_badge)HTML 徽章
<a href="https://skillstore.io/skills/sickn33-azure-cosmos-ts?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/sickn33-azure-cosmos-ts/security.svg" alt="Skillstore security assessment" loading="lazy"></a>嵌入卡片
<iframe src="https://skillstore.io/embed/skills/sickn33-azure-cosmos-ts.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>学术引用 (APA · BibTeX · CFF)
APA 引用
sickn33. (2026). azure-cosmos-ts security audit report (audit version 5) [Author version unspecified]. Skillstore. https://skillstore.io/skills/sickn33-azure-cosmos-ts/audits/5BibTeX 引用
@techreport{sickn33-sickn33-azure-cosmos-ts-2026,
author = {sickn33},
title = {azure-cosmos-ts security audit report (audit version 5)},
institution = {Skillstore},
year = {2026},
number = {5},
url = {https://skillstore.io/skills/sickn33-azure-cosmos-ts/audits/5},
note = {Author version unspecified}
}CITATION.cff
cff-version: 1.2.0
message: "If you use this Skill, cite its author and this versioned security audit report."
title: "azure-cosmos-ts security audit report (audit version 5)"
version: "unspecified"
type: report
authors:
- name: "sickn33"
date-released: "2026-07-23"
url: "https://skillstore.io/skills/sickn33-azure-cosmos-ts/audits/5"
identifiers:
- type: other
value: "skillstore:sickn33-azure-cosmos-ts:audit:5"
description: "Skillstore immutable audit report identifier"
Skillstore 评分
评分依据 证据置信度: 高你能构建什么
创建 TypeScript 数据层
设计类型化服务,用清晰的分区键处理方式读取和写入 Cosmos DB 文档。
提升 Cosmos DB 查询安全性
将临时查询示例转换为带有分页和跨分区指导的参数化 SDK 调用。
处理运行时错误
添加对缺失文档、冲突、速率限制、ETag 以及重试感知型服务行为的处理。
试试这些提示
Show me how to configure a CosmosClient in TypeScript. Use DefaultAzureCredential and environment variables for account settings.
Draft a TypeScript service for products in Cosmos DB. Include create, read by id, replace, upsert, patch, and delete flows.
Help me write parameterized Cosmos DB queries with pagination. Explain when cross-partition queries are appropriate.
Review my Cosmos DB data access design. Focus on partition keys, bulk operations, 429 handling, ETags, and credential choices.
最佳实践
- 当环境支持时,优先使用带有 DefaultAzureCredential 的 Microsoft Entra 身份验证。
- 使用参数化查询和显式分区键,以提升安全性、成本效率和性能。
- 将 404、409、412 和 429 响应作为正常运行场景处理。
避免
- 不要在应用程序源文件中硬编码账户密钥或连接字符串。
- 当可以提供分区键时,不要默认使用跨分区查询。
- 不要在没有重试、遥测和测试的情况下将示例代码视为生产就绪。