Skip to content

Conversation

@william051200
Copy link
Member

@william051200 william051200 commented Dec 30, 2025

Related command

az disk create
az disk update

Description

Migration from mgmt.compute to aaz-based

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 December 30, 2025 06:38
@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Dec 30, 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
Type Test Case Error Message Line
Failed test_help_loads The error message is too long, please check the pipeline log for details. src/azure-cli-core/azure/cli/core/tests/test_help.py:120
❌3.13
Type Test Case Error Message Line
Failed test_help_loads The error message is too long, please check the pipeline log for details. src/azure-cli-core/azure/cli/core/tests/test_help.py:120
️✔️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
Type Test Case Error Message Line
Failed test_mariadb_private_link_scenario The error message is too long, please check the pipeline log for details. azure/cli/command_modules/network/tests/latest/test_private_endpoint_commands.py:649
Failed test_mysql_private_link_scenario The error message is too long, please check the pipeline log for details. azure/cli/command_modules/network/tests/latest/test_private_endpoint_commands.py:656
❌3.13
Type Test Case Error Message Line
Failed test_mariadb_private_link_scenario The error message is too long, please check the pipeline log for details. azure/cli/command_modules/network/tests/latest/test_private_endpoint_commands.py:649
Failed test_mysql_private_link_scenario The error message is too long, please check the pipeline log for details. azure/cli/command_modules/network/tests/latest/test_private_endpoint_commands.py:656
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.13
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.13
️✔️profile
️✔️latest
️✔️3.12
️✔️3.13
❌rdbms
❌latest
❌3.12
Type Test Case Error Message Line
Failed test_flexible_server_ssdv2_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:91
Failed test_flexible_server_ssdv2_restore_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:106
Failed test_postgres_flexible_server_byok_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:116
Failed test_postgres_flexible_server_empty_rg_name The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:81
Failed test_postgres_flexible_server_georestore_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:101
Failed test_postgres_flexible_server_ltr The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:111
Failed test_postgres_flexible_server_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:76
Failed test_postgres_flexible_server_mgmt_case_insensitive The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:86
Failed test_postgres_flexible_server_public_revivedropped_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:123
Failed test_postgres_flexible_server_restore_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:96
Failed test_postgres_flexible_server_proxy_resource The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:1014
Failed test_postgres_flexible_server_mgmt_update_validator The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:1123
Failed test_postgres_flexible_server_auto_grow_replica_validator The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:1263
Failed test_postgres_flexible_server_replica_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:1257
Failed test_postgres_flexible_server_vnet_mgmt_supplied_subnet_id_in_different_rg The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:1484
Failed test_postgres_flexible_server_vnet_mgmt_supplied_subnetid The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:1473
Failed test_postgres_flexible_server_vnet_mgmt_supplied_vname_and_subnetname The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:1479
Failed test_postgres_flexible_server_existing_private_dns_zone The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:1879
Failed test_postgres_flexible_server_new_private_dns_zone The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:1885
Failed test_postgres_flexible_server_upgrade_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:2143
Failed test_postgres_flexible_server_backups_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:2196
Failed test_postgresql_flexible_server_identity_microsoft_entra_admin_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:2248
Failed test_postgresql_flexible_server_identity_microsoft_entra_admin_only_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:2253
Failed test_postgres_flexible_server_advanced_threat_protection_setting_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:2420
Failed test_postgres_flexible_server_logs_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:2469
Failed test_postgres_flexible_server_private_endpoint_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:2528
Failed test_postgres_flexible_server_fabric_mirroring_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:2730
Failed test_elastic_clusters_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:2784
Failed test_postgres_flexible_server_index_tuning_options The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:2849
Failed test_postgres_flexible_server_autonomous_tuning_options The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:2908
Failed test_postgres_flexible_server_migration The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands_postgres_migration.py:19
Failed test_postgres_flexible_server_onpremise_migration The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands_postgres_migration.py:23
❌3.13
Type Test Case Error Message Line
Failed test_flexible_server_ssdv2_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:91
Failed test_flexible_server_ssdv2_restore_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:106
Failed test_postgres_flexible_server_byok_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:116
Failed test_postgres_flexible_server_empty_rg_name The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:81
Failed test_postgres_flexible_server_georestore_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:101
Failed test_postgres_flexible_server_ltr The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:111
Failed test_postgres_flexible_server_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:76
Failed test_postgres_flexible_server_mgmt_case_insensitive The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:86
Failed test_postgres_flexible_server_public_revivedropped_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:123
Failed test_postgres_flexible_server_restore_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:96
Failed test_postgres_flexible_server_proxy_resource The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:1014
Failed test_postgres_flexible_server_mgmt_update_validator The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:1123
Failed test_postgres_flexible_server_auto_grow_replica_validator The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:1263
Failed test_postgres_flexible_server_replica_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:1257
Failed test_postgres_flexible_server_vnet_mgmt_supplied_subnet_id_in_different_rg The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:1484
Failed test_postgres_flexible_server_vnet_mgmt_supplied_subnetid The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:1473
Failed test_postgres_flexible_server_vnet_mgmt_supplied_vname_and_subnetname The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:1479
Failed test_postgres_flexible_server_existing_private_dns_zone The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:1879
Failed test_postgres_flexible_server_new_private_dns_zone The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:1885
Failed test_postgres_flexible_server_upgrade_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:2143
Failed test_postgres_flexible_server_backups_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:2196
Failed test_postgresql_flexible_server_identity_microsoft_entra_admin_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:2248
Failed test_postgresql_flexible_server_identity_microsoft_entra_admin_only_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:2253
Failed test_postgres_flexible_server_advanced_threat_protection_setting_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:2420
Failed test_postgres_flexible_server_logs_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:2469
Failed test_postgres_flexible_server_private_endpoint_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:2528
Failed test_postgres_flexible_server_fabric_mirroring_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:2730
Failed test_elastic_clusters_mgmt The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:2784
Failed test_postgres_flexible_server_index_tuning_options The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:2849
Failed test_postgres_flexible_server_autonomous_tuning_options The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py:2908
Failed test_postgres_flexible_server_migration The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands_postgres_migration.py:19
Failed test_postgres_flexible_server_onpremise_migration The error message is too long, please check the pipeline log for details. azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands_postgres_migration.py:23
️✔️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
Type Test Case Error Message Line
Failed test_confidential_disk_encryption_set self = <azure.cli.testsdk.base.ExecutionResult object at 0x7f7f2f2a16d0>
cli_ctx = <azure.cli.core.mock.DummyCli object at 0x7f7f318e7cb0>
command = 'disk create -g cli_test_confidential_disk_encryption_set_000001 -n d1-000005 --security-type ConfidentialVM_DiskEncry...re-vm-disk-encryption-set des-000004 --image-reference "MicrosoftWindowsServer:windows-cvm:2022-datacenter-cvm:latest"'
expect_failure = False

    def in_process_execute(self, cli_ctx, command, expect_failure=False):
        from io import StringIO
        from vcr.errors import CannotOverwriteExistingCassetteException
    
        if command.startswith('az '):
            command = command[3:]
    
        stdout_buf = StringIO()
        logging_buf = StringIO()
        try:
            # issue: stderr cannot be redirect in this form, as a result some failure information
            # is lost when command fails.
>           self.exit_code = cli_ctx.invoke(shlex.split(command), out_file=stdout_buf) or 0
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/azure-cli-testsdk/azure/cli/testsdk/base.py:303: 
                                        
env/lib/python3.12/site-packages/knack/cli.py:245: in invoke
    exit_code = self.exception_handler(ex)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^
src/azure-cli-core/azure/cli/core/init.py:133: in exception_handler
    return handle_exception(ex)
           ^^^^^^^^^^^^^^^^^^^^
src/azure-cli-testsdk/azure/cli/testsdk/patches.py:33: in handle_main_exception
    raise ex
env/lib/python3.12/site-packages/knack/cli.py:233: in invoke
    cmd_result = self.invocation.execute(args)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
src/azure-cli-core/azure/cli/core/commands/init.py:666: in execute
    raise ex
src/azure-cli-core/azure/cli/core/commands/init.py:734: in run_jobs_serially
    results.append(self.run_job(expanded_arg, cmd_copy))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
src/azure-cli-core/azure/cli/core/commands/init.py:703: in run_job
    result = cmd_copy(params)
             ^^^^^^^^^^^^^^^^
src/azure-cli-core/azure/cli/core/commands/init.py:336: in call
    return self.handler(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
src/azure-cli-core/azure/cli/core/commands/command_operation.py:120: in handler
    return op(**command_args)
           ^^^^^^^^^^^^^^^^^^
src/azure-cli/azure/cli/command_modules/vm/custom.py:588: in create_managed_disk
    secure_vm_disk_encryption_set = DiskEncryptionSetShow(cli_ctx=cmd.cli_ctx)(command_args={
src/azure-cli-core/azure/cli/core/aaz/command.py:155: in call
    return self.handler(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
src/azure-cli/azure/cli/command_modules/vm/aaz/latest/disk_encryption_set/__cmds.py:1494: in handler
    self.execute_operations()
src/azure-cli/azure/cli/command_modules/vm/aaz/latest/disk_encryption_set/__cmds.py:1521: in execute_operations
    self.DiskEncryptionSetsGet(ctx=self.ctx)()
src/azure-cli/azure/cli/command_modules/vm/aaz/latest/disk_encryption_set/__cmds.py:1541: in call
    session = self.client.send_request(request=request, stream=False, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
src/azure-cli-core/azure/cli/core/aaz/client.py:108: in send_request
    session = self.pipeline.run(request, stream=stream, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.12/site-packages/azure/core/pipeline/base.py:242: in run
    return first_node.send(pipeline_request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.12/site-packages/azure/core/pipeline/base.py:98: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.12/site-packages/azure/core/pipeline/base.py:98: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.12/site-packages/azure/core/pipeline/base.py:98: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.12/site-packages/azure/core/pipeline/base.py:98: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.12/site-packages/azure/core/pipeline/base.py:98: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.12/site-packages/azure/mgmt/core/policies/base.py:95: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.12/site-packages/azure/core/pipeline/policies/redirect.py:205: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.12/site-packages/azure/core/pipeline/policies/retry.py:545: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
src/azure-cli-core/azure/cli/core/aaz/http_policy.py:112: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.12/site-packages/azure/core/pipeline/base.py:98: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.12/site-packages/azure/core/pipeline/base.py:98: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.12/site-packages/azure/core/pipeline/base.py:98: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.12/site-packages/azure/core/pipeline/base.py:98: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.12/site-packages/azure/core/pipeline/base.py:98: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.12/site-packages/azure/core/pipeline/base.py:130: in send
    self.sender.send(request.http_request, **request.context.options),
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.12/site-packages/azure/core/pipeline/transport/requests_basic.py:375: in send
    response = self.session.request(  # type: ignore
env/lib/python3.12/site-packages/requests/sessions.py:589: in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.12/site-packages/requests/sessions.py:703: in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.12/site-packages/requests/adapters.py:667: in send
    resp = conn.urlopen(
env/lib/python3.12/site-packages/urllib3/connectionpool.py:787: in urlopen
    response = self.make_request(
env/lib/python3.12/site-packages/urllib3/connectionpool.py:534: in make_request
    response = conn.getresponse()
               ^^^^^^^^^^^^^^^^^^
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
         

self = <VCRRequestsHTTPSConnection/mnt/vss/work/1/s/src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_confidential_disk_encryption_set.yaml(host='management.azure.com', port=443) at 0x7f7f2e6b0650>
 = False, kwargs = {}

    def getresponse(self, =False, **kwargs):
        """Retrieve the response"""
        # Check to see if the cassette has a response for this request. If so,
        # then return it
        if self.cassette.can_play_response_for(self.vcr_request):
            log.info(f"Playing response for {self.vcr_request} from cassette")
            response = self.cassette.play_response(self.vcr_request)
            return VCRHTTPResponse(response)
        else:
            if self.cassette.write_protected and self.cassette.filter_request(self.vcr_request):
>               raise CannotOverwriteExistingCassetteException(
                    cassette=self.cassette,
                    failed_request=self.vcr_request,
                )
E               vcr.errors.CannotOverwriteExistingCassetteException: Can't overwrite existing cassette ('/mnt/vss/work/1/s/src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_confidential_disk_encryption_set.yaml') in your current record mode ('once').
E               No match for the request (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_confidential_disk_encryption_set_000001/providers/Microsoft.Compute/diskEncryptionSets/des-000004?api-version=2023-04-02>)&nbsp;was&nbsp;found.
E               Found 2 similar requests with 0 different matcher(s) :
E               
E               1 - (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_confidential_disk_encryption_set_000001/providers/Microsoft.Compute/diskEncryptionSets/des-000004?api-version=2023-04-02>).
E               Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path', 'custom_request_query_matcher']
E               Matchers failed :
E               
E               2 - (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_confidential_disk_encryption_set_000001/providers/Microsoft.Compute/diskEncryptionSets/des-000004?api-version=2023-04-02>).
E               Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path', 'custom_request_query_matcher']
E               Matchers failed :

env/lib/python3.12/site-packages/vcr/stubs/init.py:277: CannotOverwriteExistingCassetteException

During handling of the above exception, another exception occurred:

self = <latest.test_vm_commands.DiskEncryptionSetTest testMethod=test_confidential_disk_encryption_set>
resource_group = 'cli_test_confidential_disk_encryption_set_000001'

    @ResourceGroupPreparer(name_prefix='cli_test_confidential_disk_encryption_set
', location='westus')
    @AllowLargeResponse(size_kb=99999)
    def test_confidential_disk_encryption_set(self, resource_group):
        self.kwargs.update({
            'vault': self.create_random_name(prefix='vault-', length=20),
            'key': self.create_random_name(prefix='key-', length=20),
            'des': self.create_random_name(prefix='des-', length=20),
            'disk1': self.create_random_name(prefix='d1-', length=20),
            'disk2': self.create_random_name(prefix='d2-', length=20),
            'vm': self.create_random_name(prefix='vm1-', length=20),
            'policy_path': os.path.join(TEST_DIR, 'keyvault', 'policy2.json').replace('\', '\\'),
            'image': 'MicrosoftWindowsServer:windows-cvm:2022-datacenter-cvm:latest'
        })
    
        self.cmd('keyvault create --name {vault} -g {rg} --sku Premium --enable-purge-protection true --retention-days 7 --enable-rbac-authorization false')
        vault_id = self.cmd('keyvault show -g {rg} -n {vault}').get_output_in_json()['id']
        kid = self.cmd('keyvault key create --vault-name {vault} --name {key} --ops wrapKey unwrapKey --kty RSA-HSM --size 3072 --exportable true --policy "{policy_path}"').get_output_in_json()['key']['kid']
    
        self.kwargs.update({
            'vault_id': vault_id,
            'kid': kid
        })
    
        self.cmd('disk-encryption-set create -g {rg} -n {des} --key-url {kid} --encryption-type ConfidentialVmEncryptedWithCustomerKey', checks=[
            self.check('encryptionType', 'ConfidentialVmEncryptedWithCustomerKey')
        ])
        des_show_output = self.cmd('disk-encryption-set show -g {rg} -n {des}').get_output_in_json()
        des_sp_id = des_show_output['identity']['principalId']
        des_id = des_show_output['id']
        self.kwargs.update({
            'des_sp_id': des_sp_id,
            'des_id': des_id
        })
    
        self.cmd('keyvault set-policy -n {vault} -g {rg} --object-id {des_sp_id} --key-permissions wrapKey unwrapKey get')
    
        time.sleep(15)
    
        with mock.patch('azure.cli.command_modules.role.custom.gen_guid', side_effect=self.create_guid):
            self.cmd('role assignment create --assignee {des_sp_id} --role Reader --scope {vault_id}')
    
        time.sleep(15)
    
        self.kwargs.update({
            'des_pattern': '.*/{}$'.format(self.kwargs['des']),
        })
    
        # test raise error if only specified --secure-vm-disk-encryption-set but not --secure-type
        with self.assertRaises(ArgumentUsageError):
            self.cmd('disk create -g {rg} -n {disk1} --hyper-v-generation V2 --secure-vm-disk-encryption-set {des} --image-reference "{image}"')
    
        # test raise error if specified 'ConfidentialVM_DiskEncryptedWithCustomerKey' for --secure-type but didn't specify --secure-vm-disk-encryption-set
        with self.assertRaises(ArgumentUsageError):
            self.cmd('disk create -g {rg} -n {disk1} --hyper-v-generation V2 --security-type ConfidentialVM_DiskEncryptedWithCustomerKey --image-reference "{image}"')
    
        # create disk with des name
>       self.cmd('disk create -g {rg} -n {disk1} --security-type ConfidentialVM_DiskEncryptedWithCustomerKey --hyper-v-generation V2 --secure-vm-disk-encryption-set {des} --image-reference "{image}"', checks=[
            self.check_pattern('securityProfile.secureVMDiskEncryptionSetId', self.kwargs['des_pattern']),
            self.check('securityProfile.securityType', 'ConfidentialVM_DiskEncryptedWithCustomerKey')
        ])

src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py:10534: 
 
 
 
 
 
 
 
 
                                
src/azure-cli-testsdk/azure/cli/testsdk/base.py:177: in cmd
    return execute(self.cli_ctx, command, expect_failure=expect_failure).assert_with_checks(checks)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
src/azure-cli-testsdk/azure/cli/testsdk/base.py:252: in init
    self.in_process_execute(cli_ctx, command, expect_failure=expect_failure)
 
                                       

self = <azure.cli.testsdk.base.ExecutionResult object at 0x7f7f2f2a16d0>
cli_ctx = <azure.cli.core.mock.DummyCli object at 0x7f7f318e7cb0>
command = 'disk create -g cli_test_confidential_disk_encryption_set_000001 -n d1-000005 --security-type ConfidentialVM_DiskEncry...re-vm-disk-encryption-set des-000004 --image-reference "MicrosoftWindowsServer:windows-cvm:2022-datacenter-cvm:latest"'
expect_failure = False

    def _in_process_execute(self, cli_ctx, command, expect_failure=False):
        from io import StringIO
        from vcr.errors import CannotOverwriteExistingCassetteException
    
        if command.startswith('az '):
            command = command[3:]
    
        stdout_buf = StringIO()
        logging_buf = StringIO()
        try:
            # issue: stderr cannot be redirect in this form, as a result some failure information
            # is lost when command fails.
            self.exit_code = cli_ctx.invoke(shlex.split(command), out_file=stdout_buf) or 0
            self.output = stdout_buf.getvalue()
            self.applog = logging_buf.getvalue()
    
        except CannotOverwriteExistingCassetteException as ex:
>           raise AssertionError(ex)
E           AssertionError: Can't overwrite existing cassette ('/mnt/vss/_work/1/s/src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_confidential_disk_encryption_set.yaml') in your current record mode ('once').
E           No match for the request (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_confidential_disk_encryption_set_000001/providers/Microsoft.Compute/diskEncryptionSets/des-000004?api-version=2023-04-02>)&nbsp;was&nbsp;found.
E           Found 2 similar requests with 0 different matcher(s) :
E           
E           1 - (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_confidential_disk_encryption_set_000001/providers/Microsoft.Compute/diskEncryptionSets/des-000004?api-version=2023-04-02>).
E           Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path', '_custom_request_query_matcher']
E           Matchers failed :
E           
E           2 - (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_confidential_disk_encryption_set_000001/providers/Microsoft.Compute/diskEncryptionSets/des-000004?api-version=2023-04-02>).
E           Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path', '_custom_request_query_matcher']
E           Matchers failed :

src/azure-cli-testsdk/azure/cli/testsdk/base.py:308: AssertionError
azure/cli/command_modules/vm/tests/latest/test_vm_commands.py:10477
Failed test_disk_encryption_set_disk_update The error message is too long, please check the pipeline log for details. azure/cli/command_modules/vm/tests/latest/test_vm_commands.py:10308
Failed test_disk_access The error message is too long, please check the pipeline log for details. azure/cli/command_modules/vm/tests/latest/test_vm_commands.py:10747
❌3.13
Type Test Case Error Message Line
Failed test_confidential_disk_encryption_set self = <azure.cli.testsdk.base.ExecutionResult object at 0x7f6a2f259a50>
cli_ctx = <azure.cli.core.mock.DummyCli object at 0x7f6a3232fc50>
command = 'disk create -g cli_test_confidential_disk_encryption_set_000001 -n d1-000005 --security-type ConfidentialVM_DiskEncry...re-vm-disk-encryption-set des-000004 --image-reference "MicrosoftWindowsServer:windows-cvm:2022-datacenter-cvm:latest"'
expect_failure = False

    def in_process_execute(self, cli_ctx, command, expect_failure=False):
        from io import StringIO
        from vcr.errors import CannotOverwriteExistingCassetteException
    
        if command.startswith('az '):
            command = command[3:]
    
        stdout_buf = StringIO()
        logging_buf = StringIO()
        try:
            # issue: stderr cannot be redirect in this form, as a result some failure information
            # is lost when command fails.
>           self.exit_code = cli_ctx.invoke(shlex.split(command), out_file=stdout_buf) or 0
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/azure-cli-testsdk/azure/cli/testsdk/base.py:303: 
                                        
env/lib/python3.13/site-packages/knack/cli.py:245: in invoke
    exit_code = self.exception_handler(ex)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^
src/azure-cli-core/azure/cli/core/init.py:133: in exception_handler
    return handle_exception(ex)
           ^^^^^^^^^^^^^^^^^^^^
src/azure-cli-testsdk/azure/cli/testsdk/patches.py:33: in handle_main_exception
    raise ex
env/lib/python3.13/site-packages/knack/cli.py:233: in invoke
    cmd_result = self.invocation.execute(args)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
src/azure-cli-core/azure/cli/core/commands/init.py:666: in execute
    raise ex
src/azure-cli-core/azure/cli/core/commands/init.py:734: in run_jobs_serially
    results.append(self.run_job(expanded_arg, cmd_copy))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
src/azure-cli-core/azure/cli/core/commands/init.py:703: in run_job
    result = cmd_copy(params)
             ^^^^^^^^^^^^^^^^
src/azure-cli-core/azure/cli/core/commands/init.py:336: in call
    return self.handler(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
src/azure-cli-core/azure/cli/core/commands/command_operation.py:120: in handler
    return op(**command_args)
           ^^^^^^^^^^^^^^^^^^
src/azure-cli/azure/cli/command_modules/vm/custom.py:588: in create_managed_disk
    secure_vm_disk_encryption_set = DiskEncryptionSetShow(cli_ctx=cmd.cli_ctx)(command_args={
src/azure-cli-core/azure/cli/core/aaz/command.py:155: in call
    return self.handler(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
src/azure-cli/azure/cli/command_modules/vm/aaz/latest/disk_encryption_set/__cmds.py:1269: in handler
    self.execute_operations()
src/azure-cli/azure/cli/command_modules/vm/aaz/latest/disk_encryption_set/__cmds.py:1296: in execute_operations
    self.DiskEncryptionSetsGet(ctx=self.ctx)()
src/azure-cli/azure/cli/command_modules/vm/aaz/latest/disk_encryption_set/__cmds.py:1316: in call
    session = self.client.send_request(request=request, stream=False, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
src/azure-cli-core/azure/cli/core/aaz/client.py:108: in send_request
    session = self.pipeline.run(request, stream=stream, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.13/site-packages/azure/core/pipeline/base.py:242: in run
    return first_node.send(pipeline_request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.13/site-packages/azure/core/pipeline/base.py:98: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.13/site-packages/azure/core/pipeline/base.py:98: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.13/site-packages/azure/core/pipeline/base.py:98: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.13/site-packages/azure/core/pipeline/base.py:98: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.13/site-packages/azure/core/pipeline/base.py:98: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.13/site-packages/azure/mgmt/core/policies/base.py:95: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.13/site-packages/azure/core/pipeline/policies/redirect.py:205: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.13/site-packages/azure/core/pipeline/policies/retry.py:545: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
src/azure-cli-core/azure/cli/core/aaz/http_policy.py:112: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.13/site-packages/azure/core/pipeline/base.py:98: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.13/site-packages/azure/core/pipeline/base.py:98: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.13/site-packages/azure/core/pipeline/base.py:98: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.13/site-packages/azure/core/pipeline/base.py:98: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.13/site-packages/azure/core/pipeline/base.py:98: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.13/site-packages/azure/core/pipeline/base.py:130: in send
    self.sender.send(request.http_request, **request.context.options),
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.13/site-packages/azure/core/pipeline/transport/requests_basic.py:375: in send
    response = self.session.request(  # type: ignore
env/lib/python3.13/site-packages/requests/sessions.py:589: in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.13/site-packages/requests/sessions.py:703: in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.13/site-packages/requests/adapters.py:667: in send
    resp = conn.urlopen(
env/lib/python3.13/site-packages/urllib3/connectionpool.py:787: in urlopen
    response = self.make_request(
env/lib/python3.13/site-packages/urllib3/connectionpool.py:534: in make_request
    response = conn.getresponse()
               ^^^^^^^^^^^^^^^^^^
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
         

self = <VCRRequestsHTTPSConnection/mnt/vss/work/1/s/src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_confidential_disk_encryption_set.yaml(host='management.azure.com', port=443) at 0x7f6a2ee1f650>
 = False, kwargs = {}

    def getresponse(self, =False, **kwargs):
        """Retrieve the response"""
        # Check to see if the cassette has a response for this request. If so,
        # then return it
        if self.cassette.can_play_response_for(self.vcr_request):
            log.info(f"Playing response for {self.vcr_request} from cassette")
            response = self.cassette.play_response(self.vcr_request)
            return VCRHTTPResponse(response)
        else:
            if self.cassette.write_protected and self.cassette.filter_request(self.vcr_request):
>               raise CannotOverwriteExistingCassetteException(
                    cassette=self.cassette,
                    failed_request=self.vcr_request,
                )
E               vcr.errors.CannotOverwriteExistingCassetteException: Can't overwrite existing cassette ('/mnt/vss/work/1/s/src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_confidential_disk_encryption_set.yaml') in your current record mode ('once').
E               No match for the request (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_confidential_disk_encryption_set_000001/providers/Microsoft.Compute/diskEncryptionSets/des-000004?api-version=2023-04-02>)&nbsp;was&nbsp;found.
E               Found 2 similar requests with 0 different matcher(s) :
E               
E               1 - (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_confidential_disk_encryption_set_000001/providers/Microsoft.Compute/diskEncryptionSets/des-000004?api-version=2023-04-02>).
E               Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path', 'custom_request_query_matcher']
E               Matchers failed :
E               
E               2 - (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_confidential_disk_encryption_set_000001/providers/Microsoft.Compute/diskEncryptionSets/des-000004?api-version=2023-04-02>).
E               Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path', 'custom_request_query_matcher']
E               Matchers failed :

env/lib/python3.13/site-packages/vcr/stubs/init.py:277: CannotOverwriteExistingCassetteException

During handling of the above exception, another exception occurred:

self = <latest.test_vm_commands.DiskEncryptionSetTest testMethod=test_confidential_disk_encryption_set>
resource_group = 'cli_test_confidential_disk_encryption_set_000001'

    @ResourceGroupPreparer(name_prefix='cli_test_confidential_disk_encryption_set
', location='westus')
    @AllowLargeResponse(size_kb=99999)
    def test_confidential_disk_encryption_set(self, resource_group):
        self.kwargs.update({
            'vault': self.create_random_name(prefix='vault-', length=20),
            'key': self.create_random_name(prefix='key-', length=20),
            'des': self.create_random_name(prefix='des-', length=20),
            'disk1': self.create_random_name(prefix='d1-', length=20),
            'disk2': self.create_random_name(prefix='d2-', length=20),
            'vm': self.create_random_name(prefix='vm1-', length=20),
            'policy_path': os.path.join(TEST_DIR, 'keyvault', 'policy2.json').replace('\', '\\'),
            'image': 'MicrosoftWindowsServer:windows-cvm:2022-datacenter-cvm:latest'
        })
    
        self.cmd('keyvault create --name {vault} -g {rg} --sku Premium --enable-purge-protection true --retention-days 7 --enable-rbac-authorization false')
        vault_id = self.cmd('keyvault show -g {rg} -n {vault}').get_output_in_json()['id']
        kid = self.cmd('keyvault key create --vault-name {vault} --name {key} --ops wrapKey unwrapKey --kty RSA-HSM --size 3072 --exportable true --policy "{policy_path}"').get_output_in_json()['key']['kid']
    
        self.kwargs.update({
            'vault_id': vault_id,
            'kid': kid
        })
    
        self.cmd('disk-encryption-set create -g {rg} -n {des} --key-url {kid} --encryption-type ConfidentialVmEncryptedWithCustomerKey', checks=[
            self.check('encryptionType', 'ConfidentialVmEncryptedWithCustomerKey')
        ])
        des_show_output = self.cmd('disk-encryption-set show -g {rg} -n {des}').get_output_in_json()
        des_sp_id = des_show_output['identity']['principalId']
        des_id = des_show_output['id']
        self.kwargs.update({
            'des_sp_id': des_sp_id,
            'des_id': des_id
        })
    
        self.cmd('keyvault set-policy -n {vault} -g {rg} --object-id {des_sp_id} --key-permissions wrapKey unwrapKey get')
    
        time.sleep(15)
    
        with mock.patch('azure.cli.command_modules.role.custom.gen_guid', side_effect=self.create_guid):
            self.cmd('role assignment create --assignee {des_sp_id} --role Reader --scope {vault_id}')
    
        time.sleep(15)
    
        self.kwargs.update({
            'des_pattern': '.*/{}$'.format(self.kwargs['des']),
        })
    
        # test raise error if only specified --secure-vm-disk-encryption-set but not --secure-type
        with self.assertRaises(ArgumentUsageError):
            self.cmd('disk create -g {rg} -n {disk1} --hyper-v-generation V2 --secure-vm-disk-encryption-set {des} --image-reference "{image}"')
    
        # test raise error if specified 'ConfidentialVM_DiskEncryptedWithCustomerKey' for --secure-type but didn't specify --secure-vm-disk-encryption-set
        with self.assertRaises(ArgumentUsageError):
            self.cmd('disk create -g {rg} -n {disk1} --hyper-v-generation V2 --security-type ConfidentialVM_DiskEncryptedWithCustomerKey --image-reference "{image}"')
    
        # create disk with des name
>       self.cmd('disk create -g {rg} -n {disk1} --security-type ConfidentialVM_DiskEncryptedWithCustomerKey --hyper-v-generation V2 --secure-vm-disk-encryption-set {des} --image-reference "{image}"', checks=[
            self.check_pattern('securityProfile.secureVMDiskEncryptionSetId', self.kwargs['des_pattern']),
            self.check('securityProfile.securityType', 'ConfidentialVM_DiskEncryptedWithCustomerKey')
        ])

src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py:10534: 
 
 
 
 
 
 
 
 
                                
src/azure-cli-testsdk/azure/cli/testsdk/base.py:177: in cmd
    return execute(self.cli_ctx, command, expect_failure=expect_failure).assert_with_checks(checks)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
src/azure-cli-testsdk/azure/cli/testsdk/base.py:252: in init
    self.in_process_execute(cli_ctx, command, expect_failure=expect_failure)
 
                                       

self = <azure.cli.testsdk.base.ExecutionResult object at 0x7f6a2f259a50>
cli_ctx = <azure.cli.core.mock.DummyCli object at 0x7f6a3232fc50>
command = 'disk create -g cli_test_confidential_disk_encryption_set_000001 -n d1-000005 --security-type ConfidentialVM_DiskEncry...re-vm-disk-encryption-set des-000004 --image-reference "MicrosoftWindowsServer:windows-cvm:2022-datacenter-cvm:latest"'
expect_failure = False

    def _in_process_execute(self, cli_ctx, command, expect_failure=False):
        from io import StringIO
        from vcr.errors import CannotOverwriteExistingCassetteException
    
        if command.startswith('az '):
            command = command[3:]
    
        stdout_buf = StringIO()
        logging_buf = StringIO()
        try:
            # issue: stderr cannot be redirect in this form, as a result some failure information
            # is lost when command fails.
            self.exit_code = cli_ctx.invoke(shlex.split(command), out_file=stdout_buf) or 0
            self.output = stdout_buf.getvalue()
            self.applog = logging_buf.getvalue()
    
        except CannotOverwriteExistingCassetteException as ex:
>           raise AssertionError(ex)
E           AssertionError: Can't overwrite existing cassette ('/mnt/vss/_work/1/s/src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_confidential_disk_encryption_set.yaml') in your current record mode ('once').
E           No match for the request (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_confidential_disk_encryption_set_000001/providers/Microsoft.Compute/diskEncryptionSets/des-000004?api-version=2023-04-02>)&nbsp;was&nbsp;found.
E           Found 2 similar requests with 0 different matcher(s) :
E           
E           1 - (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_confidential_disk_encryption_set_000001/providers/Microsoft.Compute/diskEncryptionSets/des-000004?api-version=2023-04-02>).
E           Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path', '_custom_request_query_matcher']
E           Matchers failed :
E           
E           2 - (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_confidential_disk_encryption_set_000001/providers/Microsoft.Compute/diskEncryptionSets/des-000004?api-version=2023-04-02>).
E           Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path', '_custom_request_query_matcher']
E           Matchers failed :

src/azure-cli-testsdk/azure/cli/testsdk/base.py:308: AssertionError
azure/cli/command_modules/vm/tests/latest/test_vm_commands.py:10477
Failed test_disk_encryption_set_disk_update The error message is too long, please check the pipeline log for details. azure/cli/command_modules/vm/tests/latest/test_vm_commands.py:10308
Failed test_disk_access The error message is too long, please check the pipeline log for details. azure/cli/command_modules/vm/tests/latest/test_vm_commands.py:10747

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

Hi @william051200,
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

azure-client-tools-bot-prd bot commented Dec 30, 2025

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

@yonzhan
Copy link
Collaborator

yonzhan commented Dec 30, 2025

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

@github-actions
Copy link

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
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 VM disk commands from the legacy mgmt.compute SDK to the newer AAZ (Azure CLI Auto-generation)-based approach. The migration affects the az disk create and az disk update commands.

Key Changes

  • Replaced resource_id() utility calls with AAZ Show command invocations for disk-encryption-set and disk-access resources to retrieve full resource IDs
  • Removed the compute_disk_sdk parameter from the disk command group registration
  • Added a new _validate_gallery_image_reference_by_aaz validator function to replace the SDK-based version

Reviewed changes

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

File Description
src/azure-cli/azure/cli/command_modules/vm/operations/disk.py Updated DiskUpdate class to use AAZ Show commands (DiskEncryptionSetShow, DiskAccessShow) instead of resource_id utility for resolving resource names to IDs
src/azure-cli/azure/cli/command_modules/vm/custom.py Updated create_managed_disk function to use AAZ Show commands for disk_encryption_set, disk_access, and secure_vm_disk_encryption_set resolution
src/azure-cli/azure/cli/command_modules/vm/commands.py Removed compute_disk_sdk parameter from disk command group, completing migration to AAZ-based commands
src/azure-cli/azure/cli/command_modules/vm/_validators.py Added new _validate_gallery_image_reference_by_aaz function and commented out API version check in _validate_upload_type

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

Comment on lines 2059 to 2063
# if not cmd.supported_api_version(min_api='2021-08-01', operation_group='disks'):
# raise ArgumentUsageError(
# "'UploadWithSecurityData' is not supported in the current profile. "
# "Please upgrade your profile with 'az cloud set --profile newerProfile' and try again")

Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

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

Commented-out code should be removed. This API version check was commented out during the migration to AAZ, but commented code should not be left in production. If the check is no longer needed because AAZ handles API version compatibility automatically, remove these lines entirely. If the check is still needed, it should be uncommented and properly implemented for AAZ commands.

Suggested change
# if not cmd.supported_api_version(min_api='2021-08-01', operation_group='disks'):
# raise ArgumentUsageError(
# "'UploadWithSecurityData' is not supported in the current profile. "
# "Please upgrade your profile with 'az cloud set --profile newerProfile' and try again")

Copilot uses AI. Check for mistakes.
Comment on lines 50 to 58
disk_encryption_set = DiskEncryptionSetShow(cli_ctx=self.cli_ctx)(command_args={
'resource_group': args.resource_group,
'disk_encryption_set_name': disk_encryption_set
})

if disk_encryption_set:
disk_encryption_set = disk_encryption_set['id']
else:
disk_encryption_set = None
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

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

Missing error handling for DiskEncryptionSetShow. AAZ Show commands raise HttpResponseError when the resource is not found, but this code doesn't catch that exception. The current code will fail with an unhandled exception if the disk encryption set doesn't exist. You should wrap this call in a try-except block to catch HttpResponseError, similar to the pattern used in get_network_lb in _validators.py (lines 1720-1726).

Copilot uses AI. Check for mistakes.
Comment on lines 69 to 77
disk_access = DiskAccessShow(cli_ctx=self.cli_ctx)(command_args={
'resource_group': args.resource_group,
'disk_access_name': disk_access
})

if disk_access:
disk_access = disk_access['id']
else:
disk_access = None
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

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

Missing error handling for DiskAccessShow. AAZ Show commands raise HttpResponseError when the resource is not found, but this code doesn't catch that exception. The current code will fail with an unhandled exception if the disk access doesn't exist. You should wrap this call in a try-except block to catch HttpResponseError, similar to the pattern used in get_network_lb in _validators.py (lines 1720-1726).

Copilot uses AI. Check for mistakes.
disk_access = disk_access['id']
else:
disk_access = None

Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

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

Trailing whitespace detected on this line. Please remove it.

Suggested change

Copilot uses AI. Check for mistakes.
Comment on lines 554 to 562
disk_encryption_set = DiskEncryptionSetShow(cli_ctx=cmd.cli_ctx)(command_args={
'resource_group': resource_group_name,
'disk_encryption_set_name': disk_encryption_set
})

if disk_encryption_set:
disk_encryption_set = disk_encryption_set['id']
else:
disk_encryption_set = None
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

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

Missing error handling for DiskEncryptionSetShow. AAZ Show commands raise HttpResponseError when the resource is not found, but this code doesn't catch that exception. The current code will fail with an unhandled exception if the disk encryption set doesn't exist. You should wrap this call in a try-except block to catch HttpResponseError, similar to the pattern used in get_network_lb in _validators.py (lines 1720-1726).

Copilot uses AI. Check for mistakes.
Comment on lines 566 to 574
disk_access = DiskAccessShow(cli_ctx=cmd.cli_ctx)(command_args={
'resource_group': resource_group_name,
'disk_access_name': disk_access
})

if disk_access:
disk_access = disk_access['id']
else:
disk_access = None
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

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

Missing error handling for DiskAccessShow. AAZ Show commands raise HttpResponseError when the resource is not found, but this code doesn't catch that exception. The current code will fail with an unhandled exception if the disk access doesn't exist. You should wrap this call in a try-except block to catch HttpResponseError, similar to the pattern used in get_network_lb in _validators.py (lines 1720-1726).

Copilot uses AI. Check for mistakes.
Comment on lines 578 to 586
secure_vm_disk_encryption_set = DiskEncryptionSetShow(cli_ctx=cmd.cli_ctx)(command_args={
'resource_group': resource_group_name,
'disk_encryption_set_name': secure_vm_disk_encryption_set
})

if secure_vm_disk_encryption_set:
secure_vm_disk_encryption_set = secure_vm_disk_encryption_set['id']
else:
secure_vm_disk_encryption_set = None
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

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

Missing error handling for DiskEncryptionSetShow. AAZ Show commands raise HttpResponseError when the resource is not found, but this code doesn't catch that exception. The current code will fail with an unhandled exception if the secure VM disk encryption set doesn't exist. You should wrap this call in a try-except block to catch HttpResponseError, similar to the pattern used in get_network_lb in _validators.py (lines 1720-1726).

Copilot uses AI. Check for mistakes.
@william051200 william051200 changed the title [Compute] vm disk migration [Compute] disk command migration Dec 30, 2025
@william051200 william051200 changed the title [Compute] disk command migration {Compute} disk command migration Dec 31, 2025
@william051200 william051200 deleted the vm-disk-migration branch January 2, 2026 02:13
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.

4 participants