Skip to content

az vm create surfaces RuntimeError "The content for this response was already consumed" and hides underlying deployment validation errors #34509

Backlog

Description

Describe the bug

While creating a VM using Azure CLI, the deployment correctly fails due to an Azure-side validation error (for example RequestDisallowedByAzure or SkuNotAvailable).

However, Azure CLI then throws an additional Python exception:

RuntimeError: The content for this response was already consumed

This secondary exception obscures the original deployment error and makes troubleshooting significantly harder.

The deployment error itself appears valid and useful, but the CLI crashes while attempting to process or display the failure details.

Expected behavior would be for Azure CLI to return only the underlying deployment validation error without generating an additional traceback.

Related command

az vm create
--resource-group az900-rg-uae
--name az900-vm
--image Ubuntu2204
--size Standard_B1s
--generate-ssh-keys

Errors

RuntimeError: The content for this response was already consumed

File "/usr/lib64/az/lib/python3.12/site-packages/requests/models.py", line 899, in content
raise RuntimeError("The content for this response was already consumed")
RuntimeError: The content for this response was already consumed

Issue script & Debug output

I can provide sanitized --debug output if requested.

The issue reproduces when az vm create encounters deployment validation failures and Azure CLI attempts to process the response.

Expected behavior

Azure CLI should display the original deployment error only.

Example:

SkuNotAvailable or RequestDisallowedByAzure

without throwing an additional exception:

RuntimeError: The content for this response was already consumed

Environment Summary

azure-cli 2.91.0 *

core 2.91.0 *
telemetry 1.1.0

Extensions:
ml 2.45.2
ssh 2.0.9

Dependencies:
msal 1.39.0
azure-mgmt-resource 24.0.0

Python location '/usr/bin/python3.12'
Config directory '/home/azureuser/.azure'
Extensions directory '/home/azureuser/.azure/cliextensions'
Extensions system directory '/usr/lib/python3.12/site-packages/azure-cli-extensions'

Python (Linux) 3.12.16 (main, Nov 16 2026, 15:02:47) [GCC 13.2.0]

Additional context

No response

Activity

  1. added
    bug
    on Dec 1, 2026
  2. added
    customer-reported
    Compute
    Azure CLI Team
    question
    on Dec 1, 2026
  3. removed
    question
    on Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Azure CLI TeamComputeact-observability-squadbugcustomer-reported

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions