diff --git a/src/azure-cli/azure/cli/command_modules/vm/_params.py b/src/azure-cli/azure/cli/command_modules/vm/_params.py index cdd3e204932..3ab22dcd16b 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/_params.py +++ b/src/azure-cli/azure/cli/command_modules/vm/_params.py @@ -474,7 +474,7 @@ def load_arguments(self, _): c.argument('enable_user_redeploy_scheduled_events', options_list=['--enable-user-redeploy-scheduled-events', '--enable-redeploy'], arg_type=get_three_state_flag(), min_api='2024-07-01', help='The configuration parameter used while creating user initiated redeploy scheduled event setting creation.') c.argument('align_regional_disks_to_vm_zone', options_list=['--align-regional-disks-to-vm-zone', '--align-regional-disks'], arg_type=get_three_state_flag(), min_api='2024-11-01', help='Specify whether the regional disks should be aligned/moved to the VM zone. This is applicable only for VMs with placement property set. Please note that this change is irreversible.') c.argument('key_incarnation_id', type=int, min_api='2024-11-01', help='Increase the value of this property allows user to reset the key used for securing communication channel between guest and host.') - c.argument('security_type', arg_type=get_enum_type(["TrustedLaunch", "Standard", "ConfidentialVM"], default=None), help='Specify the security type of the virtual machine. The value Standard can be used if subscription has feature flag UseStandardSecurityType registered under Microsoft.Compute namespace. Refer to https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/preview-features for steps to enable required feature.') + c.argument('security_type', arg_type=get_enum_type(["TrustedLaunch", "Standard", "ConfidentialVM"], default=None), help='Specify the security type of the virtual machine.') c.argument('zone_movement', arg_type=get_three_state_flag(), help='Indicates if zone movement is enabled. By default isEnabled is set to false i.e VM can\'t be moved from one zone to another.') with self.argument_context('vm create', arg_group='Storage') as c: @@ -938,7 +938,7 @@ def load_arguments(self, _): c.argument('security_posture_reference_is_overridable', arg_type=get_three_state_flag(), min_api='2024-03-01', options_list=['--security-posture-reference-is-overridable', '--is-overridable'], help='Whether the security posture can be overridden by the user.') c.argument('zone_balance', arg_type=get_three_state_flag(), min_api='2017-12-01', help='Whether to force strictly even Virtual Machine distribution cross x-zones in case there is zone outage.') c.argument('security_type', arg_type=get_enum_type(["TrustedLaunch", "Standard", "ConfidentialVM"], default=None), - help='Specify the security type of the virtual machine scale set. The value Standard can be used if subscription has feature flag UseStandardSecurityType registered under Microsoft.Compute namespace. Refer to https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/preview-features for steps to enable required feature.') + help='Specify the security type of the virtual machine scale set.') c.argument('enable_automatic_zone_balancing', arg_type=get_three_state_flag(), options_list=['--enable-automatic-zone-balancing', '--enable-zone-balancing'], min_api='2024-11-01', help='Specify whether automatic AZ balancing should be enabled on the virtualmachine scale set.') c.argument('automatic_zone_balancing_strategy', arg_type=get_enum_type(self.get_models('RebalanceStrategy')), options_list=['--automatic-zone-balancing-strategy', '--balancing-strategy'], min_api='2024-11-01', help='Type of rebalance strategy that will be used for rebalancing virtualmachines in the scale set across availability zones.') c.argument('automatic_zone_balancing_behavior', arg_type=get_enum_type(self.get_models('RebalanceBehavior')), options_list=['--automatic-zone-balancing-behavior', '--balancing-behavior'], min_api='2024-11-01', help='Type of rebalance behavior that will be used for recreating virtualmachines in the scale set across availability zones.') diff --git a/src/azure-cli/azure/cli/command_modules/vm/_template_builder.py b/src/azure-cli/azure/cli/command_modules/vm/_template_builder.py index 30fe7067345..c50d0379423 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/_template_builder.py +++ b/src/azure-cli/azure/cli/command_modules/vm/_template_builder.py @@ -747,7 +747,7 @@ def _build_storage_profile(): } vm = { - 'apiVersion': '2025-04-01', + 'apiVersion': '2025-11-01', 'type': 'Microsoft.Compute/virtualMachines', 'name': name, 'location': location, @@ -1717,7 +1717,7 @@ def build_vmss_resource(cmd, name, computer_name_prefix, location, tags, overpro 'name': name, 'location': location, 'tags': tags, - 'apiVersion': '2025-04-01', + 'apiVersion': '2025-11-01', 'dependsOn': [], 'properties': vmss_properties } diff --git a/src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py b/src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py index 4905dbfca9a..569ea127763 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py +++ b/src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py @@ -5415,7 +5415,7 @@ def test_vmss_update_security_type(self): self.cmd('vmss update -g {rg} -n {vmss3} --security-type Standard') self.cmd('vmss show -g {rg} -n {vmss3}', checks=[ self.check('name', '{vmss3}'), - self.check('securityProfile', None), + self.check('virtualMachineProfile.securityProfile.securityType', 'Standard'), ]) self.cmd('vmss create -n {vmss4} -g {rg} --image {img4} --admin-username vmtest --admin-password Test123456789# --vm-sku Standard_DC2as_v5 --nsg {nsg} ' @@ -6946,7 +6946,7 @@ def test_vmss_run_command_v2(self, resource_group): '--generate-ssh-keys --orchestration-mode Uniform --lb-sku Standard --vm-sku Standard_B2ms') self.cmd('vmss show -g {rg} -n {vmss}', checks=[ self.check('name', '{vmss}'), - self.check('securityProfile', None), + self.check('virtualMachineProfile.securityProfile.securityType', 'Standard'), ]) instace_ids = self.cmd('vmss list-instances --resource-group {rg} --name {vmss} --query "[].instanceId"').get_output_in_json() self.kwargs.update({ @@ -10227,7 +10227,7 @@ def test_vm_create_special_name(self, resource_group): self.cmd('vm show -g {rg} -n {vm}', checks=[ self.check('name', '{vm}'), - self.check('securityProfile', None), + self.check('securityProfile.securityType', 'Standard'), self.check('osProfile.computerName', 'vm1') ]) @@ -12244,7 +12244,7 @@ def test_vm_trusted_launch(self, resource_group): self.cmd('vm create -g {rg} -n {vm2} --image OpenLogic:CentOS:7_6-gen2:latest --admin-username azureuser --admin-password testPassword0 ' '--subnet {subnet} --vnet-name {vnet} --size Standard_B2ms --nsg-rule None') self.cmd('vm show -g {rg} -n {vm2}', checks=[ - self.check('securityProfile', 'None') + self.check('securityProfile.securityType', 'Standard') ]) # create VM with specifying security type Standard @@ -12252,7 +12252,7 @@ def test_vm_trusted_launch(self, resource_group): self.cmd('vm create -g {rg} -n {vm3} --image canonical:0001-com-ubuntu-server-focal:20_04-lts-gen2:latest --size Standard_B2ms ' '--admin-username clitest1 --generate-ssh-key --security-type Standard --subnet {subnet} --vnet-name {vnet} --nsg-rule None') self.cmd('vm show -g {rg} -n {vm3}', checks=[ - self.check('securityProfile', 'None') + self.check('securityProfile.securityType', 'Standard') ]) @AllowLargeResponse(size_kb=99999)