Skip to content

Remove unused VS Code telemetry and azext dependencies - #20202

Open
Shenglong Li (shenglol) wants to merge 4 commits into
mainfrom
shenglol/remove-bicep-telemetry
Open

Remove unused VS Code telemetry and azext dependencies#20202
Shenglong Li (shenglol) wants to merge 4 commits into
mainfrom
shenglol/remove-bicep-telemetry

Conversation

@shenglol

@shenglol Shenglong Li (shenglol) commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Remove unused telemetry and broad utility dependencies from the Bicep VS Code extension.

  • Replace azext authentication, subscription, UI, command, and logging helpers with focused local implementations.
  • Replace shared action contexts with explicit error handling, prompt, command, and logging services.
  • Remove the VS Code telemetry reporter, activation and command events, and language-server telemetry forwarding.
  • Replace fs-extra and rimraf with Node's built-in filesystem APIs.
  • Preserve user-facing logging and error handling.

Telemetry removed

The extension collected the following Bicep-specific telemetry. None of these events is monitored or used to make product or operational decisions.

Area Data collected Why it is not useful
Extension activation Activation duration and generic error type on failure A duration and error class do not identify an actionable failure, and there is no dashboard or alert consuming the data.
Command failures Command ID and generic error type Only failures are recorded, so there is no success-rate denominator. The generic error class lacks the context needed to diagnose a defect.
Language-server connection Seconds since startup, generic error type, or closed reason This reports coarse transport health without an error message, stack, or actionable failure context.
Decompile Success or failure, output file count, conflicting file count, and failure type These are feature counters without an active product question or decision tied to them.
Paste as Bicep Paste context, paste type, source language, input JSON size, and output Bicep size The size and context dimensions are not reviewed and do not indicate whether a product change is needed.
Insert resource Resource type, API version, success or failure, and failure type These usage and outcome counters have no owner or decision process, while actionable failures are reported with context through GitHub issues.
Import Kubernetes manifest Success or failure and failure type This is an unmonitored feature counter and does not provide enough diagnostic context to fix a failure.
Deployment Succeeded or failed A deployment result alone cannot distinguish extension defects from template, authorization, policy, or Azure service failures.
External source requests Source availability, file extension, request type, archive file count, and failure type These are internal protocol and archive implementation details rather than actionable user outcomes.
Unhandled exceptions Event count with exception details removed Without the exception message or stack, the event cannot be diagnosed. Including those details would introduce unnecessary privacy risk.

The language server still emits its existing telemetry notifications. This PR only removes collection and forwarding by the VS Code extension; language-server telemetry can be evaluated separately.

Dependency reduction

The production dependency footprint drops by 84 packages (58%):

  • Production package entries: 146 -> 62
  • Total lockfile package entries: 727 -> 678, so 49 packages are removed entirely
  • Additional packages remain only as development dependencies; for example, @azure/identity remains through @vscode/vsce

Direct dependencies removed:

  • @azure/identity
  • @microsoft/vscode-azext-azureauth
  • @microsoft/vscode-azext-azureutils
  • @microsoft/vscode-azext-utils
  • fs-extra
  • @types/fs-extra
  • rimraf

@azure/core-auth is added as a focused replacement, resulting in a net reduction of 6 direct dependencies.

The azext packages share much of their dependency graph, and several Azure SDK packages remain required by the ARM clients. This is why removing the direct dependencies does not remove independent copies of every transitive package.

Bundle size

Production webpack builds were compared by summing all root-level JavaScript assets loaded by the extension runtime. Separately copied deploy-pane and visual-designer assets are excluded.

Revision Runtime JS files Raw size Gzip size
Before the Jest-to-Vitest migration (02a54d985) 16 2,411,767 bytes 534,569 bytes
Current main 16 2,412,621 bytes 534,768 bytes
This PR 5 917,343 bytes 211,070 bytes

Compared with current main, this PR reduces runtime JavaScript by 1,495,278 bytes (62.0%) raw and 323,698 bytes (60.5%) gzip. The primary extension.js file decreases from 1,364,040 bytes to 704,355 bytes (48.4%).

The pre-Vitest and current-main bundles are effectively the same size, confirming that the reduction comes from removing runtime dependencies and telemetry rather than from changing the test framework.

Validation

  • npm run clean
  • npm run test:unit - 66 tests passed
  • npm run build
  • npm run build:e2e
  • npm run lint

@github-actions

github-actions Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Test this change out locally with the following install scripts (Action run 32211670799)

VSCode
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-vsix.sh) --run-id 32211670799
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-vsix.ps1) } -RunId 32211670799"
Azure CLI
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-cli.sh) --run-id 32211670799
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-cli.ps1) } -RunId 32211670799"

Replace Azure extension helpers with local authentication, subscription, UI, command, logging, and deployment implementations.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ef00c51d-2326-446a-b862-8f55ddf5c0d0
Use explicit error handling, prompts, command services, and logging dependencies instead of shared action contexts.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ef00c51d-2326-446a-b862-8f55ddf5c0d0
Remove the telemetry reporter, dependency, activation and command events, and language-server telemetry forwarding while preserving logging and error handling.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ef00c51d-2326-446a-b862-8f55ddf5c0d0
@shenglol
Shenglong Li (shenglol) force-pushed the shenglol/remove-bicep-telemetry branch from e2f8685 to c2a9b7b Compare August 19, 2026 03:09
Use Node's built-in filesystem APIs instead of fs-extra and rimraf, and remove the corresponding direct dependencies and type package.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ef00c51d-2326-446a-b862-8f55ddf5c0d0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant