@@ -1597,6 +1597,7 @@ def update_vm(cmd, resource_group_name, vm_name, os_disk=None, disk_caching=None
15971597 vm .storage_profile .os_disk .managed_disk .id = disk_id
15981598 vm .storage_profile .os_disk .name = disk_name
15991599
1600+ from ._constants import COMPATIBLE_SECURITY_TYPE_VALUE
16001601 if security_type == "TrustedLaunch" :
16011602 from azure .cli .core .azclierror import InvalidArgumentValueError
16021603 if vm .security_profile is not None and vm .security_profile .security_type == "ConfidentialVM" :
@@ -1615,6 +1616,11 @@ def update_vm(cmd, resource_group_name, vm_name, os_disk=None, disk_caching=None
16151616 if vm .security_profile is None :
16161617 vm .security_profile = SecurityProfile ()
16171618 vm .security_profile .security_type = security_type
1619+ elif security_type == COMPATIBLE_SECURITY_TYPE_VALUE :
1620+ if vm .security_profile is None :
1621+ vm .security_profile = SecurityProfile ()
1622+ vm .security_profile .security_type = security_type
1623+ vm .security_profile .uefi_settings = None
16181624
16191625 if write_accelerator is not None :
16201626 update_write_accelerator_settings (vm .storage_profile , write_accelerator )
@@ -1683,7 +1689,7 @@ def update_vm(cmd, resource_group_name, vm_name, os_disk=None, disk_caching=None
16831689 if proximity_placement_group is not None :
16841690 vm .proximity_placement_group = {'id' : proximity_placement_group }
16851691
1686- if enable_secure_boot is not None or enable_vtpm is not None :
1692+ if security_type != COMPATIBLE_SECURITY_TYPE_VALUE and ( enable_secure_boot is not None or enable_vtpm is not None ) :
16871693 if vm .security_profile is None :
16881694 vm .security_profile = SecurityProfile ()
16891695
0 commit comments