Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
61cd029
Migrate vmss create
william051200 Feb 25, 2026
b9a1f76
Update vmss create
william051200 Feb 25, 2026
fa3bb7e
Migrate vmss show
william051200 Feb 25, 2026
8b95424
Migrate wait
william051200 Feb 25, 2026
7fad05f
Edit command
william051200 Feb 25, 2026
0253172
Fix code
william051200 Feb 26, 2026
ede83fe
Update test case and test recordings
william051200 Feb 26, 2026
955a85c
Update test recordings
william051200 Feb 26, 2026
5de1d6d
Update code
william051200 Feb 26, 2026
a19bb4f
Update test case and test recordings
william051200 Feb 26, 2026
7ab2103
Update code
william051200 Feb 27, 2026
1189f6f
Remove unused import
william051200 Feb 27, 2026
0dffa44
Update test case recording
william051200 Feb 27, 2026
b05fa84
Update test case recording
william051200 Feb 27, 2026
363299f
Update code
william051200 Mar 2, 2026
0f26f94
Merge remote-tracking branch 'origin/dev' into vmss-migration
william051200 Mar 9, 2026
b1b71b6
Update test case recording
william051200 Mar 9, 2026
56b654a
Remove unused func
william051200 Mar 9, 2026
2c19a7d
Merge remote-tracking branch 'origin/dev' into vmss-migration
william051200 Mar 10, 2026
2337b9c
Update code
william051200 Mar 12, 2026
8f281bc
Merge remote-tracking branch 'origin/dev' into vmss-migration
william051200 Mar 15, 2026
1f2fd9c
Merge remote-tracking branch 'origin/dev' into vmss-migration
william051200 Mar 19, 2026
4ccd27d
Update test case recording
william051200 Mar 19, 2026
3bdd546
Merge remote-tracking branch 'origin/dev' into vmss-migration
william051200 Mar 20, 2026
5e67b97
Update test case recording
william051200 Mar 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ interactions:
User-Agent:
- AZURECLI/2.63.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0)
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_monitor_autoscale000001/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1?api-version=2024-11-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_monitor_autoscale000001/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1?api-version=2025-04-01
response:
body:
string: "{\r\n \"name\": \"vmss1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_monitor_autoscale000001/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1\"\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ interactions:
User-Agent:
- AZURECLI/2.60.0 azsdk-python-core/1.30.1 Python/3.10.11 (Windows-10-10.0.22631-SP0)
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_monitor_autoscale_fixed000001/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1?api-version=2024-11-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_monitor_autoscale_fixed000001/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1?api-version=2025-04-01
response:
body:
string: "{\r\n \"name\": \"vmss1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_monitor_autoscale_fixed000001/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1\"\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ interactions:
User-Agent:
- AZURECLI/2.63.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0)
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_monitor_autoscale_predictive_policy000001/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1?api-version=2024-11-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_monitor_autoscale_predictive_policy000001/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1?api-version=2025-04-01
response:
body:
string: "{\r\n \"name\": \"vmss1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_monitor_autoscale_predictive_policy000001/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1\"\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ interactions:
User-Agent:
- AZURECLI/2.63.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0)
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_monitor_autoscale_recurring000001/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1?api-version=2024-11-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_monitor_autoscale_recurring000001/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1?api-version=2025-04-01
response:
body:
string: "{\r\n \"name\": \"vmss1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_monitor_autoscale_recurring000001/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1\"\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ interactions:
User-Agent:
- AZURECLI/2.63.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0)
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_monitor_autoscale_refine000001/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1?api-version=2024-11-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_monitor_autoscale_refine000001/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1?api-version=2025-04-01
response:
body:
string: "{\r\n \"name\": \"vmss1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_monitor_autoscale_refine000001/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1\"\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ interactions:
User-Agent:
- AZURECLI/2.63.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0)
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_monitor_autoscale_rule_with_dimensions000001/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1?api-version=2024-11-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_monitor_autoscale_rule_with_dimensions000001/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1?api-version=2025-04-01
response:
body:
string: "{\r\n \"name\": \"vmss1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_monitor_autoscale_rule_with_dimensions000001/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1\"\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ interactions:
User-Agent:
- AZURECLI/2.63.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0)
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_monitor_autoscale_rules000001/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1?api-version=2024-11-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_monitor_autoscale_rules000001/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1?api-version=2025-04-01
response:
body:
string: "{\r\n \"name\": \"vmss1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_monitor_autoscale_rules000001/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1\"\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ interactions:
User-Agent:
- AZURECLI/2.63.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0)
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_monitor_autoscale_show_predictive_metric000001/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1?api-version=2024-11-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_monitor_autoscale_show_predictive_metric000001/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1?api-version=2025-04-01
response:
body:
string: "{\r\n \"name\": \"vmss1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_monitor_autoscale_show_predictive_metric000001/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1\"\
Expand Down
22 changes: 0 additions & 22 deletions src/azure-cli/azure/cli/command_modules/vm/_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,28 +317,6 @@ def _create_image_instance(publisher, offer, sku, version):
}


def _get_latest_image_version(cli_ctx, location, publisher, offer, sku, edge_zone=None):
from azure.cli.core.azclierror import InvalidArgumentValueError
if edge_zone is not None:
from azure.cli.core.commands.client_factory import get_mgmt_service_client
from azure.cli.core.profiles import ResourceType
edge_zone_client = get_mgmt_service_client(cli_ctx, ResourceType.MGMT_COMPUTE).virtual_machine_images_edge_zone
top_one = edge_zone_client.list(location, edge_zone, publisher, offer, sku, top=1, orderby='name desc')
if not top_one:
raise InvalidArgumentValueError("Can't resolve the version of '{}:{}:{}:{}'"
.format(publisher, offer, sku, edge_zone))
else:
top_one = _compute_client_factory(cli_ctx).virtual_machine_images.list(location,
publisher,
offer,
sku,
top=1,
orderby='name desc')
if not top_one:
raise InvalidArgumentValueError("Can't resolve the version of '{}:{}:{}'".format(publisher, offer, sku))
return top_one[0].name


def _get_latest_image_version_by_aaz(cli_ctx, location, publisher, offer, sku, edge_zone=None):
from azure.cli.core.azclierror import InvalidArgumentValueError
if edge_zone is not None:
Expand Down
4 changes: 2 additions & 2 deletions src/azure-cli/azure/cli/command_modules/vm/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
validate_asg_names_or_ids, validate_keyvault, _validate_proximity_placement_group,
validate_vm_name_for_monitor_metrics)

from azure.cli.command_modules.vm._vm_utils import MSI_LOCAL_ID
from azure.cli.command_modules.vm._vm_utils import MSI_LOCAL_ID, UpgradeMode
from azure.cli.command_modules.vm._image_builder import ScriptType

from azure.cli.command_modules.monitor.validators import validate_metric_dimension
Expand All @@ -38,7 +38,7 @@ def load_arguments(self, _):
# Model imports
DiskStorageAccountTypes = self.get_models('DiskStorageAccountTypes', operation_group='disks')
SnapshotStorageAccountTypes = self.get_models('SnapshotStorageAccountTypes', operation_group='snapshots')
UpgradeMode, CachingTypes, OperatingSystemTypes = self.get_models('UpgradeMode', 'CachingTypes', 'OperatingSystemTypes')
CachingTypes, OperatingSystemTypes = self.get_models('CachingTypes', 'OperatingSystemTypes')
HyperVGenerationTypes = self.get_models('HyperVGenerationTypes')
DedicatedHostLicenseTypes = self.get_models('DedicatedHostLicenseTypes')
ReplicationMode = self.get_models('ReplicationMode', operation_group='gallery_image_versions')
Expand Down
11 changes: 7 additions & 4 deletions src/azure-cli/azure/cli/command_modules/vm/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,13 @@ def load_command_table(self, _):
g.generic_update_command('update')

with self.command_group('vmss') as g:
g.custom_command('create', 'create_vmss',
transform=DeploymentOutputLongRunningOperation(self.cli_ctx, 'Starting vmss create'),
supports_no_wait=True, table_transformer=deployment_validate_table_format,
validator=process_vmss_create_namespace, exception_handler=handle_template_based_exception)
g.custom_show_command('show', 'get_vmss_by_aaz', table_transformer=get_vmss_table_output_transformer(self, False))
g.generic_update_command('update', getter_name='get_vmss_modified_by_aaz', setter_name='update_vmss', supports_no_wait=True, command_type=compute_custom, validator=validate_vmss_update_namespace)
g.wait_command('wait', getter_name='get_vmss_by_aaz', getter_type=compute_custom)
g.custom_command('identity assign', 'assign_vmss_identity', validator=process_assign_identity_namespace)
g.custom_command('identity remove', 'remove_vmss_identity', validator=process_remove_identity_namespace, is_preview=True)
g.custom_show_command('identity show', 'show_vmss_identity')
Expand All @@ -412,12 +419,8 @@ def load_command_table(self, _):
g.custom_command('list', 'list_vmss_applications')

with self.command_group('vmss', compute_vmss_sdk, operation_group='virtual_machine_scale_sets') as g:
g.custom_command('create', 'create_vmss', transform=DeploymentOutputLongRunningOperation(self.cli_ctx, 'Starting vmss create'), supports_no_wait=True, table_transformer=deployment_validate_table_format, validator=process_vmss_create_namespace, exception_handler=handle_template_based_exception)
g.custom_command('get-instance-view', 'get_vmss_instance_view', table_transformer='{ProvisioningState:statuses[0].displayStatus, PowerState:statuses[1].displayStatus}')
g.custom_show_command('show', 'get_vmss', table_transformer=get_vmss_table_output_transformer(self, False))
g.generic_update_command('update', getter_name='get_vmss_modified_by_aaz', setter_name='update_vmss', supports_no_wait=True, command_type=compute_custom, validator=validate_vmss_update_namespace)
g.custom_command('update-instances', 'update_vmss_instances', supports_no_wait=True)
g.wait_command('wait', getter_name='get_vmss', getter_type=compute_custom)

from .aaz.latest.vmss import List as VMSSList
self.command_table['vmss list'] = VMSSList(loader=self,
Expand Down
Loading
Loading