Azure Cosmos DB Py
microsoft/skills
Build Azure Cosmos DB NoSQL services with Python/FastAPI following production-grade patterns.
Reviews and authors telemetry code in this extension. An agent skill from microsoft/vscode-cosmosdb.
$ npx skills add microsoft/vscode-cosmosdb --skill telemetry-best-practices -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install microsoft/vscode-cosmosdb telemetry-best-practices --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/microsoft/vscode-cosmosdb.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.github/skills/telemetry-best-practices .claude/skills/telemetry-best-practices && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "telemetry-best-practices" agent skill from https://github.com/microsoft/vscode-cosmosdb/tree/main/.github/skills/telemetry-best-practices into .claude/skills/telemetry-best-practices/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "telemetry-best-practices", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/microsoft/vscode-cosmosdb/tree/main/.github/skills/telemetry-best-practicesType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add microsoft/vscode-cosmosdb --skill telemetry-best-practices -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install microsoft/vscode-cosmosdb telemetry-best-practices --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/microsoft/vscode-cosmosdb.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.github/skills/telemetry-best-practices .agents/skills/telemetry-best-practices && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "telemetry-best-practices" agent skill from https://github.com/microsoft/vscode-cosmosdb/tree/main/.github/skills/telemetry-best-practices into .agents/skills/telemetry-best-practices/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "telemetry-best-practices", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add microsoft/vscode-cosmosdb --skill telemetry-best-practices -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install microsoft/vscode-cosmosdb telemetry-best-practices --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/microsoft/vscode-cosmosdb.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.github/skills/telemetry-best-practices .cursor/skills/telemetry-best-practices && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "telemetry-best-practices" agent skill from https://github.com/microsoft/vscode-cosmosdb/tree/main/.github/skills/telemetry-best-practices into .cursor/skills/telemetry-best-practices/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "telemetry-best-practices", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/microsoft/vscode-cosmosdb.git --path .github/skills/telemetry-best-practices--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add microsoft/vscode-cosmosdb --skill telemetry-best-practices -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install microsoft/vscode-cosmosdb telemetry-best-practices --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/microsoft/vscode-cosmosdb.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.github/skills/telemetry-best-practices .gemini/skills/telemetry-best-practices && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "telemetry-best-practices" agent skill from https://github.com/microsoft/vscode-cosmosdb/tree/main/.github/skills/telemetry-best-practices into .gemini/skills/telemetry-best-practices/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "telemetry-best-practices", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install microsoft/vscode-cosmosdb telemetry-best-practicesInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add microsoft/vscode-cosmosdb --skill telemetry-best-practices -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/microsoft/vscode-cosmosdb.git skills-src && mkdir -p .github/skills && cp -r skills-src/.github/skills/telemetry-best-practices .github/skills/telemetry-best-practices && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "telemetry-best-practices" agent skill from https://github.com/microsoft/vscode-cosmosdb/tree/main/.github/skills/telemetry-best-practices into .github/skills/telemetry-best-practices/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "telemetry-best-practices", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add microsoft/vscode-cosmosdb --skill telemetry-best-practices -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install microsoft/vscode-cosmosdb telemetry-best-practices --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/microsoft/vscode-cosmosdb.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.github/skills/telemetry-best-practices .opencode/skills/telemetry-best-practices && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "telemetry-best-practices" agent skill from https://github.com/microsoft/vscode-cosmosdb/tree/main/.github/skills/telemetry-best-practices into .opencode/skills/telemetry-best-practices/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "telemetry-best-practices", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
telemetry-best-practicesReviews and authors telemetry code in this extension. An agent skill from microsoft/vscode-cosmosdb.
Telemetry Best Practices is an agent skill from microsoft/vscode-cosmosdb, published by the product's own GitHub organization. Reviews and authors telemetry code in this extension. Use when adding, modifying, or reviewing any callWithTelemetryAndErrorHandling call, any context.telemetry.properties/measurements assignment, or any helper that reports stats to telemetry. Ensures no PII/EUII is emitted, that property vs. measurement usage is correct, and that event/property names are consistent.
Its SKILL.md is about 3.6k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Databases. It works with Visual Studio Code, Microsoft Azure and Azure Cosmos DB. The repository describes itself as: Azure Cosmos DB extension for VS Code. The licence is MIT.
4 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit fb4fbb4. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Telemetry Best Practices loads about 3.6k tokens when it runs. Until then it costs about 100 tokens; SKILL.md has 1,618 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from microsoft/vscode-cosmosdb at commit fb4fbb4, republished under its MIT licence (© microsoft). 1,618 words, ~3,595 tokens.
.claude/skills/telemetry-best-practices/SKILL.md (or your agent's skills folder).This extension uses @microsoft/vscode-azext-utils (callWithTelemetryAndErrorHandling, IActionContext.telemetry) to emit telemetry events. Telemetry is public — assume every property and measurement value is shipped to a backend and visible to whoever has access to the dashboards. Treat every new property as a privacy decision.
These rules apply to the entire codebase (extension host, webviews, language services, helper packages), not to any single feature area.
Apply it whenever code:
callWithTelemetryAndErrorHandling(...), callWithTelemetryAndErrorHandlingSync(...), or registers a command (which wraps the same).context.telemetry.properties.* or context.telemetry.measurements.*.report*Stats, track*, *Telemetry) that mutates an IActionContext.callWithTelemetryAndErrorHandling).The following must never appear in telemetry.properties or telemetry.measurements, and never as part of an event name:
Not PII (always allowed): the AI model identifiers modelId, modelFamily, modelVendor (vendor-published values from vscode.LanguageModelChat), bounded enums you control, durations, counts, and ratios.
A small set of Azure identifiers are OII (Organization Identifiable Information), not PII, and may be emitted as-is — but only under the predefined property names listed below. The telemetry pipeline (and @microsoft/vscode-azext-utils) recognizes these names and handles them accordingly (subscription scoping, sanitization of the resource path, organization-tier classification, etc.).
| Key | Type | Notes |
|---|---|---|
subscriptionId | string | Azure subscription GUID. |
tenantId | string | Azure / Entra tenant GUID. |
resourceId | vscode.TelemetryTrustedValue | Full ARM resource id. Must be wrapped so VS Code's telemetry layer does not re-sanitize the path. |
accountName | string | Azure resource (account) name, e.g. the Cosmos DB account name. |
context.telemetry.properties.subscriptionId = subscriptionId;
context.telemetry.properties.tenantId = tenantId;
context.telemetry.properties.accountName = account.name;
context.telemetry.properties.resourceId = new vscode.TelemetryTrustedValue(resourceId.rawId);Rules:
subId, accountId, armId, cosmosAccount, …) bypasses the special handling and counts as PII.resourceId must be wrapped in new vscode.TelemetryTrustedValue(...).resourceGroup, databaseName, containerName, …) under separate properties — only the four keys above are allowed; everything else is PII.tenantId is allowed OII, not personal data. Do not remove its predefined telemetry property or explicitly add tenant IDs
to context.valuesToMask. The library's built-in error sanitization may still redact GUIDs.context.valuesToMask so they are redacted from error messages emitted alongside
the event.crypto.randomUUID() per session/operation.'mongo' | 'postgres' | 'sqlserver'), never a free-form string.hasCustomInstructions) instead of the actual value.Keep hashes needed for local storage keys or comparisons local. For cohort selection, report only the boolean selection result, not the underlying machine-ID hash or its normalized numeric value. Reuse existing random session IDs rather than adding another identifier when they already provide the required operation correlation.
| Pattern | Action |
|---|---|
properties.fileName, properties.path, properties.basename, properties.fileBaseName | Remove. |
properties.error = err.message (raw) | Remove or replace with a category enum + sanitized code. |
properties.query, properties.sql, properties.ddl, properties.prompt, properties.response | Remove. |
properties.<anything> = someUserInput | Remove unless it is a validated bounded enum. |
OII value (subscriptionId, tenantId, resourceId, accountName) emitted under a different key | Rename to the predefined key, or remove. |
resourceId not wrapped in vscode.TelemetryTrustedValue | Wrap it. |
Event name containing a user value (e.g. `cosmosDB.${dbName}.start`) | Replace with a static event name; move the value to a bounded enum property only if safe. |
context.valuesToMask — Defense in Depth, Not a SubstituteIActionContext.valuesToMask supplies sensitive strings for sanitization by @microsoft/vscode-azext-utils.
The library sanitizes string telemetry.properties before emission, using more aggressive masking for keys containing
error or exception. Other string properties receive less aggressive masking but still use the registered values.
Non-error TelemetryTrustedValue properties bypass this sanitization, and numeric telemetry.measurements are not masked.
Registering a raw value does not mask its deterministic derivatives, such as hashes or normalized hash values.
Masks belong to the action context on which they are registered. Nested telemetry calls and separate tRPC invocations must register their own masks before operations that can fail; caller or webview masks are not automatically inherited.
For NoSQL connections, reuse maskConnectionTelemetry to register connection values and every configured credential's
account key or managed-identity client ID, including fallback credentials. Entra tenant IDs are allowed OII and are not
registered as masks. Add operation-specific masks (such as query text) separately. Explicit client-ID masks avoid relying
solely on the sanitizer's GUID detection.
Use it as a safety net for sensitive values that your code touches and might end up in a thrown error or log line you don't fully control:
// Extension host: push directly to the action context
context.valuesToMask.push(connectionString);
context.valuesToMask.push(masterKey, endpoint, databaseId, containerId);
context.valuesToMask.push(account.subscription.subscriptionId);
context.valuesToMask.push(userProvidedName); // database/container/resource names entered in a wizard
// Webview-bridged events: register on the per-webview TelemetryContext instead
telemetryContext.addMaskedValue(connectionString);
telemetryContext.addMaskedValue([endpoint, databaseId, containerId]);valuesToMask as soon as you obtain it if it could end up in an error path. This includes:subscriptionId, resourceId, and accountName — even though they are emitted as-is under their predefined keys, they should still be masked from error messages. Tenant IDs are exempt from explicit masking.properties.connectionString = cs and rely on masking; emit only privacy-safe values by construction.Telemetry.ts filter already drops falsy values; do not bypass it)./), push all forms: context.valuesToMask.push(partitionKey, partitionKey.slice(1));prompt/validateInput steps that capture user input should push the captured value before the step returns. See CosmosDBContainerNameStep, CosmosDBConnectionStringStep, CosmosDBPartitionKeyStep for the pattern.CosmosDBBranchDataProvider, AccountInfo).TelemetryContext via addMaskedValue(value) (see src/Telemetry.ts); the mask list is then applied automatically to every reportWebviewEvent / reportWebviewError call from that webview.telemetry.properties are strings, telemetry.measurements are numbers. Use them correctly:
properties. Stringify booleans (String(value)), keep enums short and bounded.measurements. Never put a number in properties just because it is convenient.NaN or Infinity — guard with a check before assignment.null/undefined. Skip the assignment if the value is missing.cosmosDB.<area>[.<subarea>].<action> (two to four camelCase segments). Keep them static — no interpolated user data. Examples currently in use: cosmosDB.nosql.queryEditor.executeQuery, cosmosDB.migration.ddlExtractor.extract. Match an existing prefix if you are adding to an existing area instead of inventing a new top-level name.camelCase, stable across versions. Renaming a key breaks dashboards and queries; prefer adding a new key over renaming.sessionId, durationMs, errorCategory).await callWithTelemetryAndErrorHandling('cosmosDB.<area>.<action>', async (ctx) => {
ctx.errorHandling.suppressDisplay = true;
ctx.errorHandling.rethrow = false;
// ... record measurements/properties (sync or async) ...
});The callback may be sync or async; keep it async whenever the work inside is async. Use this for fire-and-forget instrumentation that must never affect the user-visible flow.
IActionContextWhen per-call events would be too chatty, accumulate counters on a longer-lived context's measurements and emit a single summary event at the end. Pass that context as an extra parameter (commonly named phaseContext / rollupContext) to the reporting helper.
When the same set of properties (session id, mode, source type, etc.) appears at many call sites, put it in a single helper (enrichWithMigrationContext, enrichWithQueryEditorContext, …; <Area> is a placeholder for the actual feature name) and call that at the top of every event. Extend the helper instead of duplicating assignments.
properties.errorCategory to a bounded enum. Reuse values already used in the codebase ('ai', 'infrastructure' in migrationTelemetry.ts) before introducing new ones.error.message into properties — it will likely contain user values.ctx.errorHandling.issueProperties is the data appended to the body of the GitHub issue created when the user clicks Report an Issue. It is not a sanctioned PII channel — the same PII rules apply. Use it for diagnostic context (model id, error category, sanitized codes) that helps maintainers debug a reported issue.When reviewing a diff that touches telemetry, confirm each item:
subscriptionId, tenantId, accountName, and resourceId under those exact key names; resourceId wrapped in vscode.TelemetryTrustedValue.)measurements, strings/booleans/enums go to properties.String(value)).NaN/Infinity reach the assignment.camelCase names where the meaning matches an existing key.suppressDisplay = true and rethrow = false.context.valuesToMask as soon as it is obtained.report* / track* helper explicitly states "no file contents, paths, or names are emitted".© microsoft, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in .github/skills/telemetry-best-practices of microsoft/vscode-cosmosdb.
Open the folder on GitHubat commit fb4fbb4
Telemetry Best Practices next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Telemetry Best Practices this skillmicrosoft/vscode-cosmosdb | 200 | — | ~3.6k | Automated safety check: Pass | MIT | |
| Azure Cosmos DB Pymicrosoft/skills | 3.1k | — | ~2.8k | Automated safety check: Pass | MIT | |
| Azure Cosmos Pymicrosoft/skills | 3.1k | 1 repos | ~2.3k | Automated safety check: Pass | MIT | |
| Azure Data Tables Pymicrosoft/skills | 3.1k | 1 repos | ~2.1k | Automated safety check: Pass | MIT | |
| Microsoft Skill CreatorMicrosoftDocs/mcp | 1.9k | 3 repos | ~2.1k | Automated safety check: Pass | CC-BY-4.0 | |
| Azure Cosmosdbalinaqi/maggy | 707 | 1 repos | ~4.5k | Automated safety check: Pass | MIT |
microsoft/skills
Build Azure Cosmos DB NoSQL services with Python/FastAPI following production-grade patterns.
microsoft/skills
Azure Cosmos DB SDK for Python (NoSQL API). An agent skill from microsoft/skills.
microsoft/skills
Azure Tables SDK for Python (Storage and Cosmos DB). An agent skill from microsoft/skills.
MicrosoftDocs/mcp
Create agent skills for Microsoft technologies using official documentation.
alinaqi/maggy
Azure Cosmos DB partition keys, consistency levels, change feed, SDK patterns
microsoft/GitHub-Copilot-for-Azure
Azure Storage Services including Blob Storage, File Shares, Queue Storage, Table Storage, and Data Lake.
microsoft/vscode-cosmosdb
Detects and fixes accessibility issues in React/Fluent UI webviews.
microsoft/vscode-cosmosdb
Backport changes (current branch, a PR, a branch, or specific commits/SHAs) onto a target branch (typically a release branch like rel/).
microsoft/vscode-cosmosdb
Generate, explain, edit, and fix Azure Cosmos DB for NoSQL (SQL API) queries.
microsoft/vscode-cosmosdb
Azure Cosmos DB performance optimization and best practices guidelines for NoSQL, partitioning, queries, and SDK usage.
microsoft/vscode-cosmosdb
Drive the active Azure Cosmos DB for NoSQL Query Editor in VS Code from natural language.
Categories
Reviews and authors telemetry code in this extension. An agent skill from microsoft/vscode-cosmosdb. Telemetry Best Practices is an agent skill from microsoft/vscode-cosmosdb, published by the product's own GitHub organization. Reviews and authors telemetry code in this extension.
Telemetry Best Practices fits situations like: reviewing any callWithTelemetryAndErrorHandling call; any context.telemetry.properties/measurements assignment; any helper that reports stats to telemetry.
Run `npx skills add microsoft/vscode-cosmosdb --skill telemetry-best-practices -a claude-code`. Or copy the skill folder (.github/skills/telemetry-best-practices in microsoft/vscode-cosmosdb) into .claude/skills/telemetry-best-practices in your project. Claude Code loads it when a task matches its description.
Run `npx skills add microsoft/vscode-cosmosdb --skill telemetry-best-practices -a codex`. Or copy the skill folder (.github/skills/telemetry-best-practices in microsoft/vscode-cosmosdb) into .agents/skills/telemetry-best-practices in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add microsoft/vscode-cosmosdb --skill telemetry-best-practices -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/telemetry-best-practices, .gemini/skills/telemetry-best-practices, .github/skills/telemetry-best-practices and .opencode/skills/telemetry-best-practices in your project.
SKILL.md names no scripts, command-line tools or credentials: Telemetry Best Practices is instructions for the agent only.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Telemetry Best Practices is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 3.6k tokens (SKILL.md is roughly 14k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Telemetry Best Practices: Azure Cosmos DB Py (microsoft/skills, 3.1k stars), Azure Cosmos Py (microsoft/skills, 3.1k stars), Azure Data Tables Py (microsoft/skills, 3.1k stars) and Microsoft Skill Creator (MicrosoftDocs/mcp, 1.9k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
microsoft (a GitHub organization, an official publisher) maintains it in microsoft/vscode-cosmosdb, which has 200 GitHub stars. The repository holds 6 skills in this directory. The repository was last updated on October 6, 2026.
Source: microsoft/vscode-cosmosdb on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.