azure-cosmos-ts
建置 Azure Cosmos DB TypeScript 工作流程
在 TypeScript 中正確實作 Azure Cosmos DB 資料操作可能並不容易。此 skill 針對 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 呼叫,並加入分頁與跨分割區指引。
處理營運錯誤
新增對遺失文件、衝突、速率限制、ETags,以及具重試意識的服務行為的處理。
試試這些提示
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 回應視為一般營運情況來處理。
避免
- 不要在應用程式原始碼檔案中硬編碼帳戶金鑰或連接字串。
- 當可以提供分割區索引鍵時,不要預設使用跨分割區查詢。
- 不要在沒有重試、遙測與測試的情況下,將範例程式碼視為可用於正式環境。