-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Description
Describe the bug
When trying to enable or disable Azure Disk Encryption (ADE) on a VM it fails with the error message The request content was invalid and could not be deserialized
Related command
az vm encryption enable --name MyVM --resource-group MyRG --volume-type ALL
Errors
(InvalidRequestContent) The request content was invalid and could not be deserialized: 'Unexpected character encountered while parsing value: l. Path '', line 0, position 0.'.
Code: InvalidRequestContent
Message: The request content was invalid and could not be deserialized: 'Unexpected character encountered while parsing value: l. Path '', line 0, position 0.'.
Issue script & Debug output
cli.knack.cli: Command arguments: ['vm', 'encryption', 'enable', '--name', 'MyVM', '--resource-group', 'MyRG', '--volume-type', 'ALL', '--debug']
cli.knack.cli: init debug log:
Enable color in terminal.
cli.knack.cli: Event: Cli.PreExecute []
cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x7f765182a160>, <function OutputProducer.on_global_arguments at 0x7f7651527880>, <function CLIQuery.on_global_arguments at 0x7f765156ce00>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'vm': ['azure.cli.command_modules.vm']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name Load Time Groups Commands
cli.azure.cli.core: vm 0.235 59 228
cli.azure.cli.core: Total (1) 0.235 59 228
cli.azure.cli.core: These extensions are not installed and will be skipped: ['azext_ai_examples', 'azext_next']
cli.azure.cli.core: Loading extensions:
cli.azure.cli.core: Name Load Time Groups Commands Directory
cli.azure.cli.core: Total (0) 0.000 0 0
cli.azure.cli.core: Loaded 59 groups, 228 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command : vm encryption enable
cli.azure.cli.core: Command table: vm encryption enable
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x7f76506704a0>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/home/##redacted##/.azure/commands/2025-07-29.07-16-14.vm_encryption_enable.3109.log'.
az_command_data_logger: command args: vm encryption enable --name {} --resource-group {} --volume-type {} --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument..add_subscription_parameter at 0x7f76506c0b80>]
cli.azure.cli.core.profiles._shared: Traceback (most recent call last):
File "/usr/lib64/az/lib/python3.12/site-packages/azure/cli/core/profiles/_shared.py", line 472, in _get_attr
op = import_module(full_mod_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/importlib/init.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1387, in _gcd_import
File "", line 1360, in _find_and_load
File "", line 1310, in _find_and_load_unlocked
File "", line 488, in _call_with_frames_removed
File "", line 1387, in _gcd_import
File "", line 1360, in _find_and_load
File "", line 1324, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'azure.mgmt.compute.v2024_03_03'
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument..add_ids_arguments at 0x7f76506c3e20>, <function register_cache_arguments..add_cache_arguments at 0x7f76506c3f60>, <function register_upcoming_breaking_change_info..update_breaking_change_info at 0x7f76506f0040>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
urllib3.connectionpool: Starting new HTTPS connection (1): app.aladdin.microsoft.com:443
urllib3.connectionpool: https://app.aladdin.microsoft.com:443 "GET /api/v1.0/suggestions?query=%7B%22command%22%3A+%22vm+encryption+enable%22%2C+%22parameters%22%3A+%22--volume-type%2C--name%2C--resource-group%22%7D&clientType=AzureCli&context=%7B%22versionNumber%22%3A+%222.75.0%22%2C+%22errorType%22%3A+%22MissingRequiredParameters%22%2C+%22correlationId%22%3A+%2226533545-3743-44ea-b2d8-0a4c203dd94e%22%2C+%22subscriptionId%22%3A+%225cf7c614-ad7f-4341-8b21-484aa3a70861%22%2C+%22eventId%22%3A+%2249e77dea-bd88-4dfc-80a9-f07d726b4e20%22%7D HTTP/1.1" 200 None
cli.azure.cli.core.azclierror: Traceback (most recent call last):
File "/usr/lib/python3.12/argparse.py", line 1943, in _parse_known_args2
namespace, args = self._parse_known_args(args, namespace, intermixed)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/argparse.py", line 2230, in _parse_known_args
raise ArgumentError(None, _('the following arguments are required: %s') %
argparse.ArgumentError: the following arguments are required: --disk-encryption-keyvault
cli.azure.cli.core.azclierror: the following arguments are required: --disk-encryption-keyvault
az_command_data_logger: the following arguments are required: --disk-encryption-keyvault
Examples from AI knowledge base:
az vm encryption enable --disk-encryption-keyvault MyVault --name MyVm --resource-group MyResourceGroup --volume-type DATA
Enable disk encryption on the OS disk and/or data disks. Encrypt mounted disks. (autogenerated)
az vm encryption enable --resource-group MyResourceGroup --name MyVm --disk-encryption-keyvault MyVault
encrypt a VM using a key vault in the same resource group
https://docs.microsoft.com/en-US/cli/azure/vm/encryption#az_vm_encryption_enable
Read more about the command in reference docs
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x7f7650670720>]
az_command_data_logger: exit code: 2
cli.main: Command ran in 0.591 seconds (init: 0.136, invoke: 0.455)
telemetry.main: Begin splitting cli events and extra events, total events: 1
telemetry.client: Accumulated 0 events. Flush the clients.
telemetry.main: Finish splitting cli events and extra events, cli events: 1
telemetry.save: Save telemetry record of length 4317 in cache file under /home/##redacted##/.azure/telemetry/20250729071614649
telemetry.main: Begin creating telemetry upload process.
telemetry.process: Creating upload process: "/usr/bin/python3.12 /usr/lib/az/lib/python3.12/site-packages/azure/cli/telemetry/init.py /home/##redacted##/.azure /home/##redacted##/.azure/telemetry/20250729071614649"
telemetry.process: Return from creating process 3118
telemetry.main: Finish creating telemetry upload process.
Expected behavior
Encryption of VM starting without errors
Environment Summary
$ az --version
azure-cli 2.75.0
core 2.75.0
telemetry 1.1.0
Extensions:
azure-devops 0.26.0
ml 2.37.2
ssh 2.0.6
Dependencies:
msal 1.33.0b1
azure-mgmt-resource 23.3.0
Python location '/usr/bin/python3.12'
Config directory '/home/mischa/.azure'
Extensions directory '/home/mischa/.azure/cliextensions'
Extensions system directory '/usr/lib/python3.12/site-packages/azure-cli-extensions'
Python (Linux) 3.12.9 (main, Jun 12 2025, 19:38:44) [GCC 13.2.0]
Legal docs and information: aka.ms/AzureCliLegal
Your CLI is up-to-date.
Additional context
No response