Skip to content

Simple VM creation is failing #32548

Open

Description

Describe the bug

Folks,

Executing the below through the az interactive is failing:

az>> az group create -n mrg -l centralus

{
  "id": "/subscriptions/4b8e55ce-2e9f-491d-b221-fe1b3eedd43b/resourceGroups/mrg",
  "location": "centralus",
  "managedBy": null,
  "name": "mrg",
  "properties": {
    "provisioningState": "Succeeded"
  },
  "tags": null,
  "type": "Microsoft.Resources/resourceGroups"
}

az>> az vm create -g "mrg" -n my-vm --size Standard_D2s_v5 --public-ip-sku Standard --image Ubuntu2404 --admin-username azuser --generate-ssh-keys

The command failed with an unexpected error. Here is the traceback:
The content for this response was already consumed
Traceback (most recent call last):
  File "/usr/local/Cellar/azure-cli/2.81.0/libexec/lib/python3.13/site-packages/azure/cli/core/commands/__init__.py", line 703, in _run_job
    result = cmd_copy(params)
  File "/usr/local/Cellar/azure-cli/2.81.0/libexec/lib/python3.13/site-packages/azure/cli/core/commands/__init__.py", line 336, in __call__
    return self.handler(*args, **kwargs)
           ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/azure-cli/2.81.0/libexec/lib/python3.13/site-packages/azure/cli/core/commands/command_operation.py", line 120, in handler
    return op(**command_args)
  File "/usr/local/Cellar/azure-cli/2.81.0/libexec/lib/python3.13/site-packages/azure/cli/command_modules/vm/custom.py", line 1254, in create_vm
    LongRunningOperation(cmd.cli_ctx)(client.begin_create_or_update(resource_group_name, deployment_name, deployment))
                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/azure-cli/2.81.0/libexec/lib/python3.13/site-packages/azure/core/tracing/decorator.py", line 119, in wrapper_use_tracer
    return func(*args, **kwargs)
  File "/usr/local/Cellar/azure-cli/2.81.0/libexec/lib/python3.13/site-packages/azure/mgmt/resource/resources/v2024_11_01/operations/_operations.py", line 7094, in begin_create_or_update
    raw_result = self._create_or_update_initial(
        resource_group_name=resource_group_name,
    ...<7 lines>...
        **kwargs
    )
  File "/usr/local/Cellar/azure-cli/2.81.0/libexec/lib/python3.13/site-packages/azure/mgmt/resource/resources/v2024_11_01/operations/_operations.py", line 6987, in _create_or_update_initial
    raise HttpResponseError(response=response, error_format=ARMErrorFormat)
azure.core.exceptions.HttpResponseError: (InvalidTemplateDeployment) The template deployment 'vm_deploy_pOwJjgGqAHRncUWTyaD6ebQVWaqPHgOD' is not valid according to the validation procedure. The tracking id is '5d7aa3ab-ed42-4c63-a4ef-b393a6e917be'. See inner errors for details.
Code: InvalidTemplateDeployment
Message: The template deployment 'vm_deploy_pOwJjgGqAHRncUWTyaD6ebQVWaqPHgOD' is not valid according to the validation procedure. The tracking id is '5d7aa3ab-ed42-4c63-a4ef-b393a6e917be'. See inner errors for details.
Exception Details:	(SkuNotAvailable) The requested VM size for resource 'Following SKUs have failed for Capacity Restrictions: Standard_D2s_v5' is currently not available in location 'centralus'. Please try another size or deploy to a different location or different zone. See https://aka.ms/azureskunotavailable for details.
	Code: SkuNotAvailable
	Message: The requested VM size for resource 'Following SKUs have failed for Capacity Restrictions: Standard_D2s_v5' is currently not available in location 'centralus'. Please try another size or deploy to a different location or different zone. See https://aka.ms/azureskunotavailable for details.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/Cellar/azure-cli/2.81.0/libexec/lib/python3.13/site-packages/azure/cli/core/commands/arm.py", line 109, in handle_template_based_exception
    raise CLIError(ex.inner_exception.error.message)
                   ^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'error'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/wagnerbianchi/.azure/cliextensions/interactive/azext_interactive/azclishell/app.py", line 908, in cli_execute
    result = invocation.execute(args)
  File "/usr/local/Cellar/azure-cli/2.81.0/libexec/lib/python3.13/site-packages/azure/cli/core/commands/__init__.py", line 666, in execute
    raise ex
  File "/usr/local/Cellar/azure-cli/2.81.0/libexec/lib/python3.13/site-packages/azure/cli/core/commands/__init__.py", line 734, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
                   ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/azure-cli/2.81.0/libexec/lib/python3.13/site-packages/azure/cli/core/commands/__init__.py", line 726, in _run_job
    return cmd_copy.exception_handler(ex)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^
  File "/usr/local/Cellar/azure-cli/2.81.0/libexec/lib/python3.13/site-packages/azure/cli/core/commands/arm.py", line 112, in handle_template_based_exception
    raise_subdivision_deployment_error(ex.response.internal_response.text, ex.error.code if ex.error else None)
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/azure-cli/2.81.0/libexec/lib/python3.13/site-packages/requests/models.py", line 926, in text
    if not self.content:
           ^^^^^^^^^^^^
  File "/usr/local/Cellar/azure-cli/2.81.0/libexec/lib/python3.13/site-packages/requests/models.py", line 897, in content
    raise RuntimeError("The content for this response was already consumed")
RuntimeError: The content for this response was already consumed
To check existing issues, please visit: https://github.com/Azure/azure-cli/issues

Related command

az vm create -g "mrg" -n my-vm --size Standard_D2s_v5 --public-ip-sku Standard --image Ubuntu2404 --admin-username azuser --generate-ssh-keys

Errors

az>> az vm create -g "mrg" -n my-vm --size Standard_D2s_v5 --public-ip-sku Standard --image Ubuntu2404 --admin-username azuser --generate-ssh-keys

The command failed with an unexpected error. Here is the traceback:
The content for this response was already consumed
Traceback (most recent call last):
File "/usr/local/Cellar/azure-cli/2.81.0/libexec/lib/python3.13/site-packages/azure/cli/core/commands/init.py", line 703, in _run_job
result = cmd_copy(params)
File "/usr/local/Cellar/azure-cli/2.81.0/libexec/lib/python3.13/site-packages/azure/cli/core/commands/init.py", line 336, in call
return self.handler(*args, **kwargs)
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/azure-cli/2.81.0/libexec/lib/python3.13/site-packages/azure/cli/core/commands/command_operation.py", line 120, in handler
return op(**command_args)
File "/usr/local/Cellar/azure-cli/2.81.0/libexec/lib/python3.13/site-packages/azure/cli/command_modules/vm/custom.py", line 1254, in create_vm
LongRunningOperation(cmd.cli_ctx)(client.begin_create_or_update(resource_group_name, deployment_name, deployment))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/azure-cli/2.81.0/libexec/lib/python3.13/site-packages/azure/core/tracing/decorator.py", line 119, in wrapper_use_tracer
return func(*args, **kwargs)
File "/usr/local/Cellar/azure-cli/2.81.0/libexec/lib/python3.13/site-packages/azure/mgmt/resource/resources/v2024_11_01/operations/_operations.py", line 7094, in begin_create_or_update
raw_result = self._create_or_update_initial(
resource_group_name=resource_group_name,
...<7 lines>...
**kwargs
)
File "/usr/local/Cellar/azure-cli/2.81.0/libexec/lib/python3.13/site-packages/azure/mgmt/resource/resources/v2024_11_01/operations/_operations.py", line 6987, in _create_or_update_initial
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
azure.core.exceptions.HttpResponseError: (InvalidTemplateDeployment) The template deployment 'vm_deploy_pOwJjgGqAHRncUWTyaD6ebQVWaqPHgOD' is not valid according to the validation procedure. The tracking id is '5d7aa3ab-ed42-4c63-a4ef-b393a6e917be'. See inner errors for details.
Code: InvalidTemplateDeployment
Message: The template deployment 'vm_deploy_pOwJjgGqAHRncUWTyaD6ebQVWaqPHgOD' is not valid according to the validation procedure. The tracking id is '5d7aa3ab-ed42-4c63-a4ef-b393a6e917be'. See inner errors for details.
Exception Details: (SkuNotAvailable) The requested VM size for resource 'Following SKUs have failed for Capacity Restrictions: Standard_D2s_v5' is currently not available in location 'centralus'. Please try another size or deploy to a different location or different zone. See https://aka.ms/azureskunotavailable for details.
Code: SkuNotAvailable
Message: The requested VM size for resource 'Following SKUs have failed for Capacity Restrictions: Standard_D2s_v5' is currently not available in location 'centralus'. Please try another size or deploy to a different location or different zone. See https://aka.ms/azureskunotavailable for details.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/Cellar/azure-cli/2.81.0/libexec/lib/python3.13/site-packages/azure/cli/core/commands/arm.py", line 109, in handle_template_based_exception
raise CLIError(ex.inner_exception.error.message)
^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'error'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/wagnerbianchi/.azure/cliextensions/interactive/azext_interactive/azclishell/app.py", line 908, in cli_execute
result = invocation.execute(args)
File "/usr/local/Cellar/azure-cli/2.81.0/libexec/lib/python3.13/site-packages/azure/cli/core/commands/init.py", line 666, in execute
raise ex
File "/usr/local/Cellar/azure-cli/2.81.0/libexec/lib/python3.13/site-packages/azure/cli/core/commands/init.py", line 734, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/azure-cli/2.81.0/libexec/lib/python3.13/site-packages/azure/cli/core/commands/init.py", line 726, in _run_job
return cmd_copy.exception_handler(ex)
~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^
File "/usr/local/Cellar/azure-cli/2.81.0/libexec/lib/python3.13/site-packages/azure/cli/core/commands/arm.py", line 112, in handle_template_based_exception
raise_subdivision_deployment_error(ex.response.internal_response.text, ex.error.code if ex.error else None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/azure-cli/2.81.0/libexec/lib/python3.13/site-packages/requests/models.py", line 926, in text
if not self.content:
^^^^^^^^^^^^
File "/usr/local/Cellar/azure-cli/2.81.0/libexec/lib/python3.13/site-packages/requests/models.py", line 897, in content
raise RuntimeError("The content for this response was already consumed")
RuntimeError: The content for this response was already consumed
To check existing issues, please visit: https://github.com/Azure/azure-cli/issues

Issue script & Debug output

--

Expected behavior

To create the new VM.

Environment Summary

az>> az version
{
"azure-cli": "2.81.0",
"azure-cli-core": "2.81.0",
"azure-cli-telemetry": "1.1.0",
"extensions": {
"interactive": "1.0.0b1"
}
}
az>> az upgrade
This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
You already have the latest azure-cli version: 2.81.0
Upgrading extensions
Checking update for interactive
No stable version of 'interactive' to install. Preview versions allowed.
Latest version of 'interactive' is already installed.

Use --debug for more information
Upgrade finished.

Additional context

MacOS 15.5 (24F74)

Activity

  1. added
    bugThis issue requires a change to an existing behavior in the product in order to be resolved.
    on Dec 16, 2025
  2. yonzhan commented on Dec 16, 2025

    @yonzhan
    Collaborator

    Thank you for opening this issue, we will look into it.

  3. added
    Azure CLI TeamThe command of the issue is owned by Azure CLI team
    questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
    ARMaz resource/group/lock/tag/deployment/policy/managementapp/account management-group
    on Dec 16, 2025
  4. github-actions commented on Dec 16, 2025

    @github-actions

    Here are some similar issues that might help you. Please check if they can solve your problem.


    Possible solution (Extracted from existing issue, might be incorrect; please verify carefully)

    Solution 1:

    Change the VM size and location to ones that are available. For example, use --size Standard_D2as_v6 and --location eastus2. This worked for me.

    Reference:

    Solution 2:

    Use a different VM size that is available in the specified location. For example, use --size Standard_DC1ds_v3. Here is the exact script that works seamlessly:

    az vm create --resource-group "IntroAzureRG" --name my-vm --size Standard_DC1ds_v3 --public-ip-sku Standard --image Ubuntu2204 --admin-username azureuser --generate-ssh-keys
    

    Reference:

    Solution 3:

    Create the resource group and VM in a different location, such as eastus2, and use the interactive dashboard instead of terminal commands. The interactive dashboard can provide immediate feedback on invalid parameters, such as size.

    Reference:

    Powered by issue-sentinel

  5. wagnerbianchijr commented on Dec 16, 2025

    @wagnerbianchijr
    Author

    No luck

    ➜  ~ az group delete -n mrg
    Are you sure you want to perform this operation? (y/n): y
    ➜  ~ az group create -n mrg -l eastus2
    {
      "id": "/subscriptions/4b8e55ce-2e9f-491d-b221-fe1b3eedd43b/resourceGroups/mrg",
      "location": "eastus2",
      "managedBy": null,
      "name": "mrg",
      "properties": {
        "provisioningState": "Succeeded"
      },
      "tags": null,
      "type": "Microsoft.Resources/resourceGroups"
    }
    
    #: --size Standard_DC1ds_v3
    ➜  ~ az vm create --resource-group "mrg" --name my-vm --size Standard_DC1ds_v3 --public-ip-sku Standard --image Ubuntu2204 --admin-username azureuser --generate-ssh-keys
    The default value of '--size' will be changed to 'Standard_D2s_v5' from 'Standard_DS1_v2' in a future release.
    {"error":{"code":"DeploymentNotFound","message":"Deployment 'vm_deploy_bui5RBRiYnm0s1S3tZ7vfC9dYARDoiA9' could not be found."}}
    
    #: --size Standard_D2as_v6
    ➜  ~ az vm create --resource-group "mrg" --name my-vm --size Standard_D2as_v6 --public-ip-sku Standard --image Ubuntu2204 --admin-username azureuser --generate-ssh-keys
    The default value of '--size' will be changed to 'Standard_D2s_v5' from 'Standard_DS1_v2' in a future release.
    {"error":{"code":"DeploymentNotFound","message":"Deployment 'vm_deploy_S2MqvJtle2lswhwSekJWAuQXSkbeSZ38' could not be found."}}
    

    I'll check another --size manually, but the goal is to follow the available educational docs 😎

  6. removed
    bugThis issue requires a change to an existing behavior in the product in order to be resolved.
    on Dec 17, 2025
  7. added this to the Backlog milestone on Dec 17, 2025
  8. Nogelyk commented on Dec 17, 2025

    @Nogelyk

    Hi, ran into the same issue as pasted by OP just now when using location eastus, as an EU user i switched to austriaeast and the creation of the VM started immediately. Just thought I'd share.

    ➜ az group create --name IntroAzureRG --location austriaeast
    {
      "id": "/subscriptions/be995b5a-9e33-4431-817e-6eded28b84e7/resourceGroups/IntroAzureRG",
      "location": "austriaeast",
      "managedBy": null,
      "name": "IntroAzureRG",
      "properties": {
        "provisioningState": "Succeeded"
      },
      "tags": null,
      "type": "Microsoft.Resources/resourceGroups"
    }
    ➜ az vm create --resource-group "IntroAzureRG" --name my-vm --size Standard_D2s_v5 --public-ip-sku Standard --image Ubuntu2204 --admin-username azureuser --generate-ssh-keys
    The default value of '--size' will be changed to 'Standard_D2s_v5' from 'Standard_DS1_v2' in a future release.
    {
      "fqdns": "",
      "id": "/subscriptions/be995b5a-9e33-4431-817e-6eded28b84e7/resourceGroups/IntroAzureRG/providers/Microsoft.Compute/virtualMachines/my-vm",
      "location": "austriaeast",
      "macAddress": "7C-1E-52-8D-FD-3F",
      "powerState": "VM running",
      "privateIpAddress": "10.0.0.4",
      "publicIpAddress": "68.210.97.58",
      "resourceGroup": "IntroAzureRG"
    }
    
  9. wagnerbianchijr commented on Dec 17, 2025

    @wagnerbianchijr
    Author

    Hey, Kristof Nogely (@Nogelyk)! Thanks much for sharing your test. I confirm that works with austriaeast region.

    ➜  ~ az group create --name IntroAzureRG --location austriaeast
    {
      "id": "/subscriptions/4b8e55ce-2e9f-491d-b221-fe1b3eedd43b/resourceGroups/IntroAzureRG",
      "location": "austriaeast",
      "managedBy": null,
      "name": "IntroAzureRG",
      "properties": {
        "provisioningState": "Succeeded"
      },
      "tags": null,
      "type": "Microsoft.Resources/resourceGroups"
    }
    ➜  ~ az vm create --resource-group "IntroAzureRG" --name my-vm --size Standard_D2s_v5 --public-ip-sku Standard --image Ubuntu2204 --admin-username azureuser --generate-ssh-keys
    The default value of '--size' will be changed to 'Standard_D2s_v5' from 'Standard_DS1_v2' in a future release.
    {
      "fqdns": "",
      "id": "/subscriptions/4b8e55ce-2e9f-491d-b221-fe1b3eedd43b/resourceGroups/IntroAzureRG/providers/Microsoft.Compute/virtualMachines/my-vm",
      "location": "austriaeast",
      "macAddress": "7C-1E-52-8E-0C-22",
      "powerState": "VM running",
      "privateIpAddress": "10.0.0.4",
      "publicIpAddress": "68.210.98.9",
      "resourceGroup": "IntroAzureRG"
    }
    

    Thanks much.

    Yong Zhang (@yonzhan), thanks for classifying this as a bug. I believe we should provide clear feedback to the requesting user, specifically the one executing the az vm create command, when the requested VM SKU is not available in the selected region, rather than allowing the process to fail later.

    Adding an extra precheck step before VM creation to verify SKU availability does not seem appropriate. The GUI already handles this by filtering unavailable SKUs, and I suggest we apply the same filtering logic to the command line experience.

    Still, why for the...

    The default value of '--size' will be changed to 'Standard_D2s_v5' from 'Standard_DS1_v2' in a future release.
    

    ?

    Even if I run with another --size:

    ➜  ~ export RESOURCE_GROUP="mrg"
    export LOCATION="eastus2"
    export SIZE="Standard_B12ms"
    export VM_NAME="my-vm"
    export IMAGE="Ubuntu2404"
    export PUBLIC_IP_SKU="Standard"
    export ADMIN_USERNAME="azureuser"
    
    ➜  ~ az group create -n $RESOURCE_GROUP -l $LOCATION
    {
      "id": "/subscriptions/4b8e55ce-2e9f-491d-b221-fe1b3eedd43b/resourceGroups/mrg",
      "location": "eastus2",
      "managedBy": null,
      "name": "mrg",
      "properties": {
        "provisioningState": "Succeeded"
      },
      "tags": null,
      "type": "Microsoft.Resources/resourceGroups"
    }
    ➜  ~ az vm create \
      --resource-group "$RESOURCE_GROUP" \
      --name $VM_NAME \
      --size $SIZE \
      --public-ip-sku $PUBLIC_IP_SKU \
      --image $IMAGE \
      --admin-username $ADMIN_USERNAME \
      --generate-ssh-keys \
      --output table
    The default value of '--size' will be changed to 'Standard_D2s_v5' from 'Standard_DS1_v2' in a future release.
    

    Thanks everyone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions