{Compute} az vm/vmss list-versions/show: Support extension image release metadata - #34018
William (william051200) wants to merge 8 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The newly added live-only test has brittle assertions and direct indexing that can fail on valid-but-empty/null service responses, causing false failures.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR updates the AAZ-generated VM/VMSS extension image list-versions and show commands to use the 2026-04-01 Compute RP API version and surface the newly added extension image release/execution metadata (including support for $expand=properties on list-versions), along with a new live-only scenario test.
Changes:
- Bump API version to
2026-04-01for VM/VMSS extension imagelist-versionsandshow. - Add
--expand propertiestolist-versionsand pass it through as$expand=properties. - Extend response schemas to include release metadata fields and extension feature metadata; add a new live-only test covering the new fields.
File summaries
| File | Description |
|---|---|
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py | Adds a live-only test validating the new release/feature metadata surface area. |
| src/azure-cli/azure/cli/command_modules/vm/aaz/latest/vm/extension/image/_list_versions.py | Updates to 2026-04-01, adds --expand, and extends list response schema for new metadata fields. |
| src/azure-cli/azure/cli/command_modules/vm/aaz/latest/vm/extension/image/_show.py | Updates to 2026-04-01 and extends show response schema for new metadata fields. |
| src/azure-cli/azure/cli/command_modules/vm/aaz/latest/vmss/extension/image/_list_versions.py | Updates to 2026-04-01, adds --expand, and extends list response schema for new metadata fields. |
| src/azure-cli/azure/cli/command_modules/vm/aaz/latest/vmss/extension/image/_show.py | Updates to 2026-04-01 and extends show response schema for new metadata fields. |
Review details
Suppressed comments (1)
src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py:2596
- The test indexes
image['extensionFeatureMetadata']['extensionFeatureTags']directly and then asserts the list is non-empty and that each tag'skey/valueare truthy. If the RP returnsextensionFeatureMetadataas missing/nullor returns an emptyextensionFeatureTagsarray (still a valid shape), this will raise or fail the test even though the response includes the required property.
feature_tags = image['extensionFeatureMetadata']['extensionFeatureTags']
self.assertTrue(feature_tags)
self.assertTrue(all(tag.get('key') and tag.get('value') for tag in feature_tags))
- Files reviewed: 5/5 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| for field in ('releaseNotes', 'releaseCategory', 'urgencyLevel', 'runProfile'): | ||
| self.assertTrue(image.get(field)) | ||
|
|
|
Compute |
…1 aaz for vm extension image list-version & show
7495fa4 to
d745e30
Compare
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
| @@ -2564,6 +2564,59 @@ def test_vm_machine_extension_image(self): | |||
| self.check("contains(id, '/Providers/Microsoft.Compute/Locations/{loc}/Publishers/{pub}/ArtifactTypes/VMExtension/Types/{ext}/Versions/{ver}')", True) | |||
| ]) | |||
|
|
|||
| @live_only() | |||
| def test_vm_vmss_extension_image(self): | |||
There was a problem hiding this comment.
May I ask why we need to mark this test as live only?
There was a problem hiding this comment.
The extension that is ready for testing isn’t accessible. The current test case uses the publicly available version of the extension, which has not yet been updated on the RP side.
🤖 PR Validation —⚠️ Review suggested
Related command
az vm list-versionsaz vm showaz vmss list-versionsaz vmss showDescription
Resolve #33896
aaz Azure/aaz#1078
Testing Guide
I have added test case in
azure-cli\src\azure-cli\azure\cli\command_modules\vm\tests\latest\test_vm_commands.py:test_vm_vmss_extension_imageBut not able to run due to 2026-04-01 is not ready in the resource provider yet
History Notes
[Compute]
az vm/vmss list-versions: Add new parameter--expandto support extension image release metadataThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.