원클릭으로
azure-storage-loader
Load token usage data from Azure Table Storage for faster iteration and analysis in chat conversations
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Load token usage data from Azure Table Storage for faster iteration and analysis in chat conversations
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Find all hardcoded path-to-editor-name mappings in the CLI (cli/src/analysis.ts::getEditorSourceFromPath) and VS Code extension (src/workspaceHelpers.ts::getEditorTypeFromPath), verify they return matching friendly display names for the same path patterns, and confirm every CLI-returned name appears in the EDITOR_ICON_MAP in formatUtils.ts. Use after adding a new editor adapter, after CLI changes, or if JetBrains/other CLI-based consumers show raw editor keys instead of friendly names.
Validate that ~/.copilot/data.db has the required schema for session hierarchy (workspace_parent_links, workspaces, sessions tables and columns). Runs an actual today's-data query so schema regressions are caught early. Use when data.db schema changes may have broken hierarchy enrichment, or on a periodic schedule to detect breaking changes.
Find all hardcoded path-to-editor-name mappings in the CLI (cli/src/analysis.ts::getEditorSourceFromPath) and VS Code extension (src/workspaceHelpers.ts::getEditorTypeFromPath), verify they return matching friendly display names for the same path patterns, and confirm every CLI-returned name appears in the EDITOR_ICON_MAP in formatUtils.ts. Use after adding a new editor adapter, after CLI changes, or if JetBrains/other CLI-based consumers show raw editor keys instead of friendly names.
Find all model IDs referenced in local AI-coding session log files and debug logs, then compare them against the keys in src/modelPricing.json. Reports models found in logs that have no pricing entry (unknown — informational only) and pricing entries never observed locally (unused). Use after adding a new model to modelPricing.json, after seeing unexpected cost attributions, or to discover which new models have appeared in recent sessions. Depends on file discovery patterns from the validate-session-schemas skill.
Loop over recent local AI-coding session log files for every supported file-based platform (Copilot Chat, Copilot CLI, JetBrains, Claude Code, Gemini CLI, Antigravity, OpenCode) and validate they still match the documented schema, while surfacing newly-discovered fields we could start using. Use after an editor/CLI update, when adding a parser, or on a schedule to catch schema drift early.
Validate that ~/.copilot/data.db has the required schema for session hierarchy (workspace_parent_links, workspaces, sessions tables and columns). Runs an actual today's-data query so schema regressions are caught early. Use when data.db schema changes may have broken hierarchy enrichment, or on a periodic schedule to detect breaking changes.
| name | azure-storage-loader |
| description | Load token usage data from Azure Table Storage for faster iteration and analysis in chat conversations |
This skill enables you to load actual token usage data from Azure Table Storage into your chat conversations. This allows for faster iteration when analyzing usage patterns, testing queries, or debugging issues without needing to sync data from local session files.
The Copilot Token Tracker extension can sync token usage data to Azure Table Storage. This skill provides helper scripts to:
Use this skill when you need to:
Before using this skill, ensure you have:
The extension stores daily aggregate data in Azure Tables with the following schema:
Default: usageAggDaily (configurable via aiEngineeringFluency.backend.aggTable)
Partition Key: ds:{datasetId}|d:{YYYY-MM-DD}
Row Key: m:{model}|w:{workspaceId}|mc:{machineId}|u:{userId}
Fields:
schemaVersion (number): Schema version for compatibilitydatasetId (string): Logical dataset identifierday (string): Date in YYYY-MM-DD formatmodel (string): AI model name (e.g., "gpt-4", "claude-3-5-sonnet-20241022")workspaceId (string): Workspace identifier (sanitized)workspaceName (string, optional): Human-readable workspace namemachineId (string): Machine identifier (sanitized)machineName (string, optional): Human-readable machine nameuserId (string, optional): User identifier (if team sharing enabled)userKeyType (string, optional): Type of user identifier (pseudonymous/teamAlias/entraObjectId)shareWithTeam (boolean, optional): Whether data is shared with teamconsentAt (string, optional): ISO timestamp of consentinputTokens (number): Total input tokens for this dimensionoutputTokens (number): Total output tokens for this dimensioninteractions (number): Total interactions countupdatedAt (string): ISO timestamp of last updateAzure Tables disallow certain characters in PartitionKey/RowKey: /, \, #, ?
These are replaced with _ by the sanitizeTableKey() function in src/backend/storageTables.ts.
Uses DefaultAzureCredential for authentication:
az loginAZURE_TENANT_ID, AZURE_CLIENT_ID, AZURE_CLIENT_SECRETRequired RBAC Roles:
Storage Table Data Reader (read-only)Storage Table Data Contributor (read/write)Uses account access key stored in VS Code SecretStorage:
load-table-data.jsFetch token usage data from Azure Table Storage and output as JSON for analysis.
# Navigate to skill directory
cd .github/skills/azure-storage-loader
# Install dependencies (first time only)
npm install
# Load data with Entra ID auth
node load-table-data.js \
--storageAccount "youraccount" \
--tableName "usageAggDaily" \
--datasetId "default" \
--startDate "2026-01-01" \
--endDate "2026-01-30"
# Load data with Shared Key auth
node load-table-data.js \
--storageAccount "youraccount" \
--tableName "usageAggDaily" \
--datasetId "default" \
--startDate "2026-01-01" \
--endDate "2026-01-30" \
--sharedKey "your-account-key"
# Filter by specific model
node load-table-data.js \
--storageAccount "youraccount" \
--tableName "usageAggDaily" \
--datasetId "default" \
--startDate "2026-01-01" \
--endDate "2026-01-30" \
--model "gpt-4o"
# Output to file
node load-table-data.js \
--storageAccount "youraccount" \
--tableName "usageAggDaily" \
--datasetId "default" \
--startDate "2026-01-01" \
--endDate "2026-01-30" \
--output "usage-data.json"
--storageAccount (required): Azure Storage account name--tableName (optional): Table name (default: "usageAggDaily")--datasetId (optional): Dataset identifier (default: "default")--startDate (required): Start date in YYYY-MM-DD format--endDate (required): End date in YYYY-MM-DD format--model (optional): Filter by specific model name--workspaceId (optional): Filter by specific workspace ID--userId (optional): Filter by specific user ID--sharedKey (optional): Azure Storage account key (if not using Entra ID)--output (optional): Output file path (default: stdout)--format (optional): Output format: "json" or "csv" (default: "json")JSON array of entities:
[
{
"partitionKey": "ds:default|d:2026-01-16",
"rowKey": "m:gpt-4o|w:workspace123|mc:machine456|u:user789",
"schemaVersion": 3,
"datasetId": "default",
"day": "2026-01-16",
"model": "gpt-4o",
"workspaceId": "workspace123",
"workspaceName": "MyProject",
"machineId": "machine456",
"machineName": "MyLaptop",
"userId": "user789",
"userKeyType": "pseudonymous",
"inputTokens": 1500,
"outputTokens": 800,
"interactions": 25,
"updatedAt": "2026-01-16T23:59:59.999Z"
}
]
CSV format (when --format csv is used):
day,model,workspaceId,workspaceName,machineId,machineName,userId,userKeyType,inputTokens,outputTokens,interactions,updatedAt
2026-01-16,gpt-4o,workspace123,MyProject,machine456,MyLaptop,user789,pseudonymous,1500,800,25,2026-01-16T23:59:59.999Z
// In a chat conversation:
// "Load the last 7 days of token usage data from Azure"
// Run the helper script:
node load-table-data.js \
--storageAccount "mycopilotusage" \
--datasetId "team-alpha" \
--startDate "2026-01-23" \
--endDate "2026-01-30"
// Analyze the output in the conversation
// "Compare GPT-4 vs Claude usage for January"
// Load GPT-4 data
node load-table-data.js \
--storageAccount "mycopilotusage" \
--datasetId "team-alpha" \
--startDate "2026-01-01" \
--endDate "2026-01-31" \
--model "gpt-4o" \
--output "gpt4-jan.json"
// Load Claude data
node load-table-data.js \
--storageAccount "mycopilotusage" \
--datasetId "team-alpha" \
--startDate "2026-01-01" \
--endDate "2026-01-31" \
--model "claude-3-5-sonnet-20241022" \
--output "claude-jan.json"
// Compare in chat using the JSON files
// "Show me per-user token usage for our team this month"
node load-table-data.js \
--storageAccount "mycopilotusage" \
--datasetId "team-alpha" \
--startDate "2026-01-01" \
--endDate "2026-01-31" \
--output "team-usage.json"
// In chat, analyze the userId field to aggregate per-user totals
// "Calculate the estimated cost of our Copilot usage"
node load-table-data.js \
--storageAccount "mycopilotusage" \
--datasetId "team-alpha" \
--startDate "2026-01-01" \
--endDate "2026-01-31" \
--output "usage-for-costing.json"
// Use model pricing data (src/modelPricing.json) to calculate costs
// Group by model, multiply tokens by pricing rates
The helper script uses the same Azure SDK packages as the extension:
@azure/data-tables: Table Storage operations@azure/identity: Authentication via DefaultAzureCredentialKey extension modules referenced:
src/backend/storageTables.ts: Entity schema and query functionssrc/backend/services/dataPlaneService.ts: Table client creation and operationssrc/backend/constants.ts: Schema versions and constantsProblem: "Missing Azure RBAC data-plane permissions"
Solution: Ensure you have Storage Table Data Reader or Storage Table Data Contributor role assigned
Problem: "SharedKeyCredential is not authorized" Solution: Verify the shared key is correct and has not been rotated
Problem: No entities returned Solution:
Problem: Queries timing out with large date ranges Solution:
When running as the GitHub Copilot Coding Agent, the load-table-data.js script is executed automatically during the copilot-setup-steps.yml workflow. The aggregated usage data is downloaded to ./usage-data/usage-agg-daily.json in the workspace root.
How it works:
cd .github/skills/azure-storage-loader && npm install --productionload-table-data.js with env vars from the copilot GitHub environment./usage-data/usage-agg-daily.jsonCOPILOT_STORAGE_KEY secret) or Entra ID authenticationEnvironment variables (set in the copilot GitHub environment):
COPILOT_STORAGE_ACCOUNT (required): Storage account nameCOPILOT_TABLE_NAME (optional, default: usageAggDaily): Table nameCOPILOT_DATASET_ID (optional, default: default): Dataset identifierCOPILOT_TABLE_DATA_DAYS (optional, default: 30): Days of data to fetchCOPILOT_STORAGE_KEY (secret, optional): Storage account key for shared key authSee the session-log-data skill (.github/skills/session-log-data/SKILL.md) for details on the downloaded data format and analysis examples.
src/backend/storageTables.ts: Core table operations and schemasrc/backend/services/dataPlaneService.ts: Table client and query servicesrc/backend/services/queryService.ts: Query caching and filteringsrc/backend/constants.ts: Schema versions and configurationsrc/backend/types.ts: TypeScript type definitionspackage.json: Azure SDK dependencies