Skip to content

Migrate vm-repair telemetry from Application Insights SDK to azure.cli.core telemetry pipeline, add PII scrubbing, pseudonymous user tracking, enriched VM context, and exception type tracking.#9894

Open
EdwinBernal1 wants to merge 8 commits into
Azure:mainfrom
EdwinBernal1:edwin/vm-repair-bugfix-sfi
Open

Conversation

@EdwinBernal1
Copy link
Copy Markdown
Member

Migrate vm-repair telemetry from Application Insights SDK to azure.cli.core telemetry pipeline, add PII scrubbing, pseudonymous user tracking, enriched VM context, and exception type tracking.

This checklist is used to make sure that common guidelines for a pull request are followed.

Related command

[az vm repair]

General Guidelines

  • Have you run azdev style [az vm repair] locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (pip install wheel==0.30.0 required)
  • My extension version conforms to the Extension version schema
image image

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify src/index.json.

Edwin Bernal and others added 3 commits May 15, 2026 10:25
…nt tracking; add unit tests for telemetry functionality

Co-authored-by: Copilot <copilot@github.com>
Copilot AI review requested due to automatic review settings May 22, 2026 03:57
@azure-client-tools-bot-prd
Copy link
Copy Markdown

Validation for Breaking Change Starting...

Thanks for your contribution!

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented May 22, 2026

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link
Copy Markdown
Contributor

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

@yonzhan yonzhan assigned yanzhudd and unassigned zhoxing-ms May 22, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Migrates vm-repair telemetry from the Application Insights SDK to the Azure CLI telemetry pipeline, adding PII scrubbing and new unit tests around telemetry behavior.

Changes:

  • Replace Application Insights TelemetryClient usage with azure.cli.core.telemetry.add_extension_event.
  • Add PII scrubbing + pseudonymous user hash and pass additional telemetry context through command execution.
  • Add pytest scaffolding and unit tests for telemetry helpers and event payload shaping.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/vm-repair/setup.py Bumps version and drops opencensus dependency in line with telemetry migration.
src/vm-repair/conftest.py Adds global import-time module mocking to allow tests to run without Azure CLI installed.
src/vm-repair/azext_vm_repair/tests/latest/test_telemetry.py Adds unit tests for PII scrubbing, user hash, and telemetry event construction.
src/vm-repair/azext_vm_repair/telemetry.py Implements new telemetry pipeline integration, PII scrubbing, and context propagation.
src/vm-repair/azext_vm_repair/custom.py Enriches telemetry context with VM properties + captures exception types.
src/vm-repair/azext_vm_repair/command_helper_class.py Adds per-command telemetry context, user hash, and fixes telemetry dispatch flow.
src/vm-repair/HISTORY.rst Documents release 2.3.0 changes.

Comment thread src/vm-repair/azext_vm_repair/telemetry.py Outdated
Comment thread src/vm-repair/azext_vm_repair/telemetry.py Outdated
Comment thread src/vm-repair/azext_vm_repair/command_helper_class.py Outdated
Comment thread src/vm-repair/azext_vm_repair/telemetry.py
Comment thread src/vm-repair/azext_vm_repair/telemetry.py
Comment thread src/vm-repair/azext_vm_repair/tests/latest/test_telemetry.py Outdated
Comment thread src/vm-repair/conftest.py
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 22, 2026

@github-actions github-actions Bot added the release-version-block Updates do not qualify release version rules. NOTE: please do not edit it manually. label May 22, 2026
@EdwinBernal1 EdwinBernal1 requested a review from Copilot May 22, 2026 13:19
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.

Comment thread src/vm-repair/azext_vm_repair/telemetry.py Outdated
Comment thread src/vm-repair/azext_vm_repair/telemetry.py Outdated
Comment thread src/vm-repair/conftest.py
Comment thread src/vm-repair/conftest.py
Comment thread src/vm-repair/azext_vm_repair/tests/latest/test_telemetry.py
Comment thread src/vm-repair/azext_vm_repair/tests/latest/test_telemetry.py
@github-actions github-actions Bot removed the release-version-block Updates do not qualify release version rules. NOTE: please do not edit it manually. label May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Auto-Assign Auto assign by bot Compute

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants