Skip to content

{Compute} az vmss extension: Migrate command group to aaz-based implementation#33337

Open
william051200 wants to merge 11 commits into
Azure:devfrom
william051200:vmss-extension-migration
Open

{Compute} az vmss extension: Migrate command group to aaz-based implementation#33337
william051200 wants to merge 11 commits into
Azure:devfrom
william051200:vmss-extension-migration

Conversation

@william051200
Copy link
Copy Markdown
Member

@william051200 william051200 commented May 8, 2026

Related command

az vmss extension delete
az vmss extension show
az vmss extension set
az vmss extension list
az vmss extension upgrade

Description

Migration from mgmt.compute to aaz-based

aaz Azure/aaz#1003

Testing Guide

History Notes


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

Copilot AI review requested due to automatic review settings May 8, 2026 08:18
@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd Bot commented May 8, 2026

️✔️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
️✔️postgresql
️✔️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

azure-client-tools-bot-prd Bot commented May 8, 2026

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

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented May 8, 2026

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 May 8, 2026

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>

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

Migrates the az vmss extension command group in the VM command module from azure-mgmt-compute SDK usage to AAZ-based implementations, aligning VMSS extension operations with the newer AAZ patterns already used elsewhere in command_modules/vm.

Changes:

  • Reworked VMSS extension delete/show/list/set to use AAZ VMSS show + AAZ VMSS update flows (with snake_case conversion for update payloads).
  • Switched vmss extension upgrade to an AAZ-generated rolling upgrade command.
  • Updated command registration for vmss extension to remove the compute SDK command group binding and removed the min_api gate on upgrade.

Reviewed changes

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

File Description
src/azure-cli/azure/cli/command_modules/vm/custom.py Migrates VMSS extension CRUD operations to AAZ; builds update payloads via convert_show_result_to_snake_case and invokes AAZ vmss Update.
src/azure-cli/azure/cli/command_modules/vm/commands.py Updates vmss extension command group registration for AAZ migration and adjusts the upgrade registration.
src/azure-cli/azure/cli/command_modules/vm/aaz/latest/vmss/extension/_rolling_upgrade.py Adds AAZ-generated implementation for VMSS extension rolling upgrade.
src/azure-cli/azure/cli/command_modules/vm/aaz/latest/vmss/extension/__init__.py Exposes the new rolling upgrade command via package exports.

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

Comment on lines +5356 to +5357
x.get('type_properties_type', '').lower() != extension_name.lower()
or x.get('publisher').lower() != publisher.lower()]
@@ -5283,102 +5283,109 @@ def detach_disk_from_vmss(cmd, resource_group_name, vmss_name, lun, instance_id=

# region VirtualMachineScaleSets Extensions
def delete_vmss_extension(cmd, resource_group_name, vmss_name, extension_name):
g.custom_command('set', 'set_vmss_extension', supports_no_wait=True)
g.custom_command('list', 'list_vmss_extensions')
g.custom_command('upgrade', 'upgrade_vmss_extension', min_api='2020-06-01', supports_no_wait=True)
g.custom_command('upgrade', 'upgrade_vmss_extension', supports_no_wait=True)
Comment on lines +410 to 413
with self.command_group('vmss extension') as g:
g.custom_command('delete', 'delete_vmss_extension', supports_no_wait=True)
g.custom_show_command('show', 'get_vmss_extension')
g.custom_command('set', 'set_vmss_extension', supports_no_wait=True)
Comment on lines 5351 to +5358
if extension_profile:
extensions = extension_profile.extensions
extensions = extension_profile.get('extensions')
if extensions:
extension_profile.extensions = [x for x in extensions if
x.type_properties_type.lower() != extension_name.lower() or x.publisher.lower() != publisher.lower()] # pylint: disable=line-too-long

if cmd.supported_api_version(min_api='2019-07-01', operation_group='virtual_machine_scale_sets'):
ext = VirtualMachineScaleSetExtension(name=extension_instance_name,
publisher=publisher,
type_properties_type=extension_name,
protected_settings=protected_settings,
type_handler_version=version,
settings=settings,
auto_upgrade_minor_version=(not no_auto_upgrade),
provision_after_extensions=provision_after_extensions,
enable_automatic_upgrade=enable_auto_upgrade)
else:
ext = VirtualMachineScaleSetExtension(name=extension_instance_name,
publisher=publisher,
type=extension_name,
protected_settings=protected_settings,
type_handler_version=version,
settings=settings,
auto_upgrade_minor_version=(not no_auto_upgrade),
provision_after_extensions=provision_after_extensions,
enable_automatic_upgrade=enable_auto_upgrade)
extension_profile['extensions'] = \
[x for x in extensions if
x.get('type_properties_type', '').lower() != extension_name.lower()
or x.get('publisher').lower() != publisher.lower()]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

act-observability-squad 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