Skip to content

[connectedvmware] Fix cross-subscription VM onboarding - #10373

Open
aaronngo-microsoft wants to merge 3 commits into
Azure:mainfrom
aaronngo-microsoft:fix-connectedvmware-bugs
Open

aaronngo-microsoft wants to merge 3 commits into
Azure:mainfrom
aaronngo-microsoft:fix-connectedvmware-bugs

Conversation

@aaronngo-microsoft

Copy link
Copy Markdown

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

Related command

az connectedvmware vm create-from-machines

Summary

Fix create-from-machines when the Hybrid Compute machine and vCenter inventory are in different subscriptions.

  • Use the global --subscription context as the machine subscription.
  • Include both the machine and vCenter subscriptions in the Azure Resource Graph query.
  • Restrict the machine side of the query to the selected machine subscription.
  • Add subscription ID and subscription name help examples.
  • Add deterministic unit coverage and a live cross-subscription scenario.
  • Bump connectedvmware to version 1.2.2 and update HISTORY.rst.

Testing

  • python -m unittest azext_connectedvmware.tests.latest.test_custom azext_connectedvmware.vmware_utils_test — 14 tests passed.
  • Targeted Flake8 checks passed for the changed Python files.
  • The live cross-subscription scenario was not run locally because it requires dedicated machine and vCenter resources configured through AZURE_CONNECTEDVMWARE_TEST_* environment variables.

General Guidelines

  • Have you run azdev style connectedvmware locally? (azdev is not configured in this environment; targeted Flake8 checks passed.)
  • Have you run python scripts/ci/test_index.py -q locally? (src/index.json is unchanged.)
  • My extension version conforms to the Extension version schema.

For new extensions:

  • My extension description/summary conforms to the Extension Summary Guidelines. Not applicable; this is an existing extension.

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once this pull request is merged into main, a new pull request will update src/index.json automatically.
This pull request updates setup.py and HISTORY.rst and does not modify src/index.json.

Aaron Ngo and others added 2 commits September 21, 2026 16:09
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 21, 2026 06:29
@azure-client-tools-bot-prd

Copy link
Copy Markdown

Hi aaronngo-microsoft,
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in pyproject.toml (or setup.py, if the extension has not migrated yet) as well.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@microsoft-github-policy-service microsoft-github-policy-service Bot added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Sep 21, 2026
@microsoft-github-policy-service

Copy link
Copy Markdown
Contributor

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

@yonzhan

Copy link
Copy Markdown
Collaborator

connectedvmware

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The changes are focused, correctly scoped, and covered by unit and live-test paths.

Review effort: Lite
Findings: None

What changed in this PR

Fixes create-from-machines for machines and vCenters in different subscriptions.

Changes:

  • Scopes Resource Graph queries to both subscriptions while filtering machines to the active subscription.
  • Adds unit and live cross-subscription coverage.
  • Updates help examples, changelog, and extension version.
File Description
src/​connectedvmware/​setup.py Bumps version to 1.2.2
src/​connectedvmware/​HISTORY.rst Documents the fix
src/​connectedvmware/​azext_connectedvmware/​custom.py Implements cross-subscription query handling
src/​connectedvmware/​azext_connectedvmware/​_help.py Adds subscription examples
src/​connectedvmware/​azext_connectedvmware/​tests/​latest/​test_custom.py Adds deterministic unit coverage
src/​connectedvmware/​azext_connectedvmware/​tests/​latest/​test_connectedvmware_scenario.py Adds live scenario coverage

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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 customer-reported Issues that are reported by GitHub users external to the Azure organization.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants