Skip to content

{Compute} az restore-point: Migrate to AAZ#32391

Merged
yanzhudd merged 5 commits intoAzure:devfrom
cxznmhdcxz:restore-point-migrate
Nov 7, 2025
Merged

{Compute} az restore-point: Migrate to AAZ#32391
yanzhudd merged 5 commits intoAzure:devfrom
cxznmhdcxz:restore-point-migrate

Conversation

@cxznmhdcxz
Copy link
Copy Markdown
Member

@cxznmhdcxz cxznmhdcxz commented Nov 6, 2025

Related command

az restore-point create/show/delete

Description

aaz Azure/aaz#895

Testing Guide

History Notes

[Component Name 1] BREAKING CHANGE: az command a: Make some customer-facing breaking change
[Component Name 2] az command b: Add some customer-facing feature


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

@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd bot commented Nov 6, 2025

️✔️AzureCLI-FullTest
️✔️acr
️✔️latest
️✔️3.12
️✔️3.13
️✔️acs
️✔️latest
️✔️3.12
️✔️3.13
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.13
️✔️ams
️✔️latest
️✔️3.12
️✔️3.13
️✔️apim
️✔️latest
️✔️3.12
️✔️3.13
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.13
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️aro
️✔️latest
️✔️3.12
️✔️3.13
️✔️backup
️✔️latest
️✔️3.12
️✔️3.13
️✔️batch
️✔️latest
️✔️3.12
️✔️3.13
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.13
️✔️billing
️✔️latest
️✔️3.12
️✔️3.13
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️cdn
️✔️latest
️✔️3.12
️✔️3.13
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.13
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.13
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.13
️✔️config
️✔️latest
️✔️3.12
️✔️3.13
️✔️configure
️✔️latest
️✔️3.12
️✔️3.13
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.13
️✔️container
️✔️latest
️✔️3.12
️✔️3.13
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.13
️✔️core
️✔️latest
️✔️3.12
️✔️3.13
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.13
️✔️databoxedge
️✔️latest
️✔️3.12
️✔️3.13
️✔️dls
️✔️latest
️✔️3.12
️✔️3.13
️✔️dms
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.13
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.13
️✔️find
️✔️latest
️✔️3.12
️✔️3.13
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.13
️✔️identity
️✔️latest
️✔️3.12
️✔️3.13
️✔️iot
️✔️latest
️✔️3.12
️✔️3.13
️✔️keyvault
️✔️latest
️✔️3.12
️✔️3.13
️✔️lab
️✔️latest
️✔️3.12
️✔️3.13
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️maps
️✔️latest
️✔️3.12
️✔️3.13
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.13
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.13
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.13
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.13
️✔️network
️✔️latest
️✔️3.12
️✔️3.13
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.13
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.13
️✔️profile
️✔️latest
️✔️3.12
️✔️3.13
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.13
️✔️redis
️✔️latest
️✔️3.12
️✔️3.13
️✔️relay
️✔️latest
️✔️3.12
️✔️3.13
️✔️resource
️✔️latest
️✔️3.12
️✔️3.13
️✔️role
️✔️latest
️✔️3.12
️✔️3.13
️✔️search
️✔️latest
️✔️3.12
️✔️3.13
️✔️security
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.13
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.13
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.13
️✔️sql
️✔️latest
️✔️3.12
️✔️3.13
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.13
️✔️storage
️✔️latest
️✔️3.12
️✔️3.13
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.13
️✔️telemetry
️✔️latest
️✔️3.12
️✔️3.13
️✔️util
️✔️latest
️✔️3.12
️✔️3.13
️✔️vm
️✔️latest
️✔️3.12
️✔️3.13

@azure-client-tools-bot-prd
Copy link
Copy Markdown

Hi @cxznmhdcxz,
Since the current milestone time is less than 7 days, this pr will be reviewed in the next milestone.

@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd bot commented Nov 6, 2025

️✔️AzureCLI-BreakingChangeTest
️✔️Non Breaking Changes

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Nov 6, 2025

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

@github-actions
Copy link
Copy Markdown

github-actions bot commented Nov 6, 2025

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>

@cxznmhdcxz cxznmhdcxz force-pushed the restore-point-migrate branch from 8387cfc to cfe8fba Compare November 6, 2025 06:35
@cxznmhdcxz cxznmhdcxz marked this pull request as ready for review November 6, 2025 06:53
Copilot AI review requested due to automatic review settings November 6, 2025 06:53
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

This PR migrates the restore-point commands from SDK-based implementation to AAZ (Auto-generated Azure CLI) framework, updating to API version 2024-11-01 from 2022-08-01.

  • Migrates restore-point create, show, and wait commands to use AAZ-generated code
  • Updates API version from 2022-08-01 to 2024-11-01
  • Removes direct SDK client factory dependency (cf_restore_point)
  • Adds --size Standard_B2ms parameter to a test VM creation for more reliable test execution

Reviewed Changes

Copilot reviewed 10 out of 15 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
custom.py Refactored restore_point_create and restore_point_show to use AAZ command pattern instead of SDK client calls
commands.py Removed cf_restore_point client factory import and usage from restore-point command group
_client_factory.py Removed cf_restore_point factory function that is no longer needed
aaz/latest/restore_point/_create.py Added auto-generated AAZ implementation for restore-point create command
aaz/latest/restore_point/_show.py Added auto-generated AAZ implementation for restore-point show command
aaz/latest/restore_point/_wait.py Added auto-generated AAZ implementation for restore-point wait command
aaz/latest/restore_point/_delete.py Updated API version and LRO polling strategy to use location-based polling
aaz/latest/restore_point/__init__.py Added imports for new AAZ command implementations
aaz/latest/restore_point/__cmd_group.py Added comment referencing swagger API spec change
test_vm_commands.py Added explicit VM size to test for better reliability
Comments suppressed due to low confidence (1)

src/azure-cli/azure/cli/command_modules/vm/custom.py:5825

  • The parameter key 'excludeDisks' uses camelCase, but according to the AAZ command schema shown in _create.py, the expected argument name is 'exclude_disks' (snake_case). This inconsistency will cause the exclude_disks parameter to not be properly passed to the AAZ command.
    if exclude_disks is not None:
        parameters['excludeDisks'] = []
        for disk in exclude_disks:
            parameters['excludeDisks'].append({'id': disk})

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +5946 to +5947
from .aaz.latest.restore_point import Create
return Create(cli_ctx=cmd.cli_ctx)(command_args=parameters)
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

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

The implementation removes all custom parameter processing logic (lines 5822-5944 in the original code) that handled exclude_disks, source_restore_point, consistency_mode, storage_profile configuration, and encryption settings. The AAZ Create command expects these parameters in a specific format that differs from how they were being constructed. The parameters dictionary should be properly mapped to match AAZ command's expected argument names and structure.

Copilot uses AI. Check for mistakes.
Comment on lines +5956 to +5961
args = {
'resource_group': resource_group_name,
'restore_point_collection_name': restore_point_collection_name,
'restore_point_name': restore_point_name,
'expand': expand
}
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

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

The function parameter 'instance_view' is accepted but never used. It's only used to conditionally set expand to 'instanceView', which could overwrite the passed expand parameter. Consider removing the instance_view parameter if it's deprecated, or handle both parameters more explicitly to avoid confusion.

Copilot uses AI. Check for mistakes.
'no_wait': no_wait
}
if exclude_disks is not None:
parameters['excludeDisks'] = []
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.

I think the name of parameters may should be snake case

@yanzhudd yanzhudd merged commit ce7ffa1 into Azure:dev Nov 7, 2025
48 checks passed
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 az vm/vmss/image/disk/snapshot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants