You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
az vm create surfaces RuntimeError "The content for this response was already consumed" and hides underlying deployment validation errors #34509
Azure CLI TeamThe command of the issue is owned by Azure CLI teamComputeaz vm/vmss/image/disk/snapshotact-observability-squadbugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.
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
Azure CLI TeamThe command of the issue is owned by Azure CLI teamComputeaz vm/vmss/image/disk/snapshotact-observability-squadbugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.
Activity