Skip to content

Unable to create VM with standard security #31191

@matt-boris

Description

@matt-boris

Describe the bug

Hi there,

After upgrading to az v2.71.0, my az vm create commands fail with The value of parameter securityProfile.securityType is invalid..

After downgrading the cli via brew install --build-from-source azure-cli.rb with the file being taken from https://github.com/Homebrew/homebrew-core/blob/4ebae799157b908501142a9752101fd0e69722ba/Formula/a/azure-cli.rb the cli version is v2.70.0 and works properly with security type of Standard.

Related command

az vm create --name="az-cli-test" --image="MicrosoftWindowsServer:WindowsServer:2022-datacenter-azure-edition:latest" --resource-group=<your RG here> --computer-name="ImageBuilder" --os-disk-delete-option=Delete --data-disk-delete-option=Delete --nic-delete-option=Delete --nsg-rule=NONE --license-type="Windows_Server" --accept-term --location="eastus" --size="Standard_F32s_v2" --security-type="Standard" --admin-username=<your user here> --admin-password=<your password here>

Errors

Command failed with The value of parameter securityProfile.securityType is invalid.

Issue script & Debug output

Debug output
DEBUG: cli.knack.cli: Command arguments: ['vm', 'create', '--name=********', '--image=MicrosoftWindowsServer:WindowsServer:2022-datacenter-azure-edition:latest', '--resource-group=********', '--computer-name=ImageBuilder', '--os-disk-delete-option=Delete', '--data-disk-delete-option=Delete', '--nic-delete-option=Delete', '--nsg-rule=NONE', '--license-type=Windows_Server', '--accept-term', '--location=eastus', '--size=Standard_F32s_v2', '--security-type=Standard', '--admin-username=********', '--admin-password=********', '--debug']
DEBUG: cli.azure.cli.core.sdk.policies: {"status":"Failed","error":{"code":"DeploymentFailed","target":"/subscriptions/********/resourceGroups/********/providers/Microsoft.Resources/deployments/vm_deploy_Ab3CzBhmNVo0tKDI2MUaMetgowTc7LrJ","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"InvalidParameter","target":"securityProfile.securityType","message":"The value of parameter securityProfile.securityType is invalid."}]}}
DEBUG: cli.azure.cli.core.sdk.policies: {"status":"Failed","error":{"code":"DeploymentFailed","target":"/subscriptions/********/resourceGroups/********/providers/Microsoft.Resources/deployments/vm_deploy_Ab3CzBhmNVo0tKDI2MUaMetgowTc7LrJ","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"InvalidParameter","target":"securityProfile.securityType","message":"The value of parameter securityProfile.securityType is invalid."}]}}
DEBUG: cli.azure.cli.core.azclierror: Traceback (most recent call last):
  File "/opt/homebrew/Cellar/azure-cli/2.71.0/libexec/lib/python3.12/site-packages/azure/core/polling/base_polling.py", line 757, in run
    self._poll()
  File "/opt/homebrew/Cellar/azure-cli/2.71.0/libexec/lib/python3.12/site-packages/azure/core/polling/base_polling.py", line 789, in _poll
    raise OperationFailed("Operation failed or canceled")
azure.core.polling.base_polling.OperationFailed: Operation failed or canceled

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/homebrew/Cellar/azure-cli/2.71.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 703, in _run_job
    result = cmd_copy(params)
             ^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/azure-cli/2.71.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 336, in __call__
    return self.handler(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/azure-cli/2.71.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/command_operation.py", line 120, in handler
    return op(**command_args)
           ^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/azure-cli/2.71.0/libexec/lib/python3.12/site-packages/azure/cli/command_modules/vm/custom.py", line 1139, in create_vm
    LongRunningOperation(cmd.cli_ctx)(client.begin_create_or_update(resource_group_name, deployment_name, deployment))
  File "/opt/homebrew/Cellar/azure-cli/2.71.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 1076, in __call__
    raise exception
  File "/opt/homebrew/Cellar/azure-cli/2.71.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 1063, in __call__
    result = poller.result()
             ^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/azure-cli/2.71.0/libexec/lib/python3.12/site-packages/azure/core/polling/_poller.py", line 251, in result
    self.wait(timeout)
  File "/opt/homebrew/Cellar/azure-cli/2.71.0/libexec/lib/python3.12/site-packages/azure/core/tracing/decorator.py", line 94, in wrapper_use_tracer
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/azure-cli/2.71.0/libexec/lib/python3.12/site-packages/azure/core/polling/_poller.py", line 270, in wait
    raise self._exception  # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/azure-cli/2.71.0/libexec/lib/python3.12/site-packages/azure/core/polling/_poller.py", line 185, in _start
    self._polling_method.run()
  File "/opt/homebrew/Cellar/azure-cli/2.71.0/libexec/lib/python3.12/site-packages/azure/core/polling/base_polling.py", line 772, in run
    raise HttpResponseError(response=self._pipeline_response.http_response, error=err) from err
azure.core.exceptions.HttpResponseError: (DeploymentFailed) At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.
Code: DeploymentFailed
Message: At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.
Target: /subscriptions/********/resourceGroups/********/providers/Microsoft.Resources/deployments/vm_deploy_Ab3CzBhmNVo0tKDI2MUaMetgowTc7LrJ
Exception Details:	(InvalidParameter) The value of parameter securityProfile.securityType is invalid.
	Code: InvalidParameter
	Message: The value of parameter securityProfile.securityType is invalid.
	Target: securityProfile.securityType

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/homebrew/Cellar/azure-cli/2.71.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/arm.py", line 109, in handle_template_based_exception
    raise CLIError(ex.inner_exception.error.message)
                   ^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'OpeDEBUG: cli.azure.cli.core.azclierror: Traceback (most recent call last):
  File "/opt/homebrew/Cellar/azure-cli/2.71.0/libexec/lib/python3.12/site-packages/azure/core/polling/base_polling.py", line 757, in run
    self._poll()
  File "/opt/homebrew/Cellar/azure-cli/2.71.0/libexec/lib/python3.12/site-packages/azure/core/polling/base_polling.py", line 789, in _poll
    raise OperationFailed("Operation failed or canceled")
azure.core.polling.base_polling.OperationFailed: Operation failed or canceled

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/homebrew/Cellar/azure-cli/2.71.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 703, in _run_job
    result = cmd_copy(params)
             ^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/azure-cli/2.71.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 336, in __call__
    return self.handler(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/azure-cli/2.71.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/command_operation.py", line 120, in handler
    return op(**command_args)
           ^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/azure-cli/2.71.0/libexec/lib/python3.12/site-packages/azure/cli/command_modules/vm/custom.py", line 1139, in create_vm
    LongRunningOperation(cmd.cli_ctx)(client.begin_create_or_update(resource_group_name, deployment_name, deployment))
  File "/opt/homebrew/Cellar/azure-cli/2.71.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 1076, in __call__
    raise exception
  File "/opt/homebrew/Cellar/azure-cli/2.71.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 1063, in __call__
    result = poller.result()
             ^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/azure-cli/2.71.0/libexec/lib/python3.12/site-packages/azure/core/polling/_poller.py", line 251, in result
    self.wait(timeout)
  File "/opt/homebrew/Cellar/azure-cli/2.71.0/libexec/lib/python3.12/site-packages/azure/core/tracing/decorator.py", line 94, in wrapper_use_tracer
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/azure-cli/2.71.0/libexec/lib/python3.12/site-packages/azure/core/polling/_poller.py", line 270, in wait
    raise self._exception  # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/azure-cli/2.71.0/libexec/lib/python3.12/site-packages/azure/core/polling/_poller.py", line 185, in _start
    self._polling_method.run()
  File "/opt/homebrew/Cellar/azure-cli/2.71.0/libexec/lib/python3.12/site-packages/azure/core/polling/base_polling.py", line 772, in run
    raise HttpResponseError(response=self._pipeline_response.http_response, error=err) from err
azure.core.exceptions.HttpResponseError: (DeploymentFailed) At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.
Code: DeploymentFailed
Message: At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.
Target: /subscriptions/********/resourceGroups/********/providers/Microsoft.Resources/deployments/vm_deploy_Ab3CzBhmNVo0tKDI2MUaMetgowTc7LrJ
Exception Details:	(InvalidParameter) The value of parameter securityProfile.securityType is invalid.
	Code: InvalidParameter
	Message: The value of parameter securityProfile.securityType is invalid.
	Target: securityProfile.securityType

During handling of the above exception, another exception occurred:

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

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/homebrew/Cellar/azure-cli/2.71.0/libexec/lib/python3.12/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/azure-cli/2.71.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 666, in execute
    raise ex
  File "/opt/homebrew/Cellar/azure-cli/2.71.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 734, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/azure-cli/2.71.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 726, in _run_job
    return cmd_copy.exception_handler(ex)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/azure-cli/2.71.0/libexec/lib/python3.12/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 "/opt/homebrew/Cellar/azure-cli/2.71.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/arm.py", line 104, in raise_subdivision_deployment_error
    raise DeploymentError(error_message)
azure.cli.core.azclierror.DeploymentError: {"status":"Failed","error":{"code":"DeploymentFailed","target":"/subscriptions/********/resourceGroups/********/providers/Microsoft.Resources/deployments/vm_deploy_Ab3CzBhmNVo0tKDI2MUaMetgowTc7LrJ","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"InvalidParameter","target":"securityProfile.securityType","message":"The value of parameter securityProfile.securityType is invalid."}]}}

rationFailed' object has no attribute 'error'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/homebrew/Cellar/azure-cli/2.71.0/libexec/lib/python3.12/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/azure-cli/2.71.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 666, in execute
    raise ex
  File "/opt/homebrew/Cellar/azure-cli/2.71.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 734, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/azure-cli/2.71.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 726, in _run_job
    return cmd_copy.exception_handler(ex)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/azure-cli/2.71.0/libexec/lib/python3.12/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 "/opt/homebrew/Cellar/azure-cli/2.71.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/arm.py", line 104, in raise_subdivision_deployment_error
    raise DeploymentError(error_message)
azure.cli.core.azclierror.DeploymentError: {"status":"Failed","error":{"code":"DeploymentFailed","target":"/subscriptions/********/resourceGroups/********/providers/Microsoft.Resources/deployments/vm_deploy_Ab3CzBhmNVo0tKDI2MUaMetgowTc7LrJ","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"InvalidParameter","target":"securityProfile.securityType","message":"The value of parameter securityProfile.securityType is invalid."}]}}

ERROR: cli.azure.cli.core.azclierror: {"status":"Failed","error":{"code":"DeploymentFailed","target":"/subscriptions/********/resourceGroups/********/providers/Microsoft.Resources/deployments/vm_deploy_Ab3CzBhmNVo0tKDI2MUaMetgowTc7LrJ","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"InvalidParameter","target":"securityProfile.securityType","message":"The value of parameter securityProfile.securityType is invalid."}]}}
ERROR: cli.azure.cli.core.azclierror: {"status":"Failed","error":{"code":"DeploymentFailed","target":"/subscriptions/********/resourceGroups/********/providers/Microsoft.Resources/deployments/vm_deploy_Ab3CzBhmNVo0tKDI2MUaMetgowTc7LrJ","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"InvalidParameter","target":"securityProfile.securityType","message":"The value of parameter securityProfile.securityType is invalid."}]}}
ERROR: az_command_data_logger: {"status":"Failed","error":{"code":"DeploymentFailed","target":"/subscriptions/********/resourceGroups/********/providers/Microsoft.Resources/deployments/vm_deploy_Ab3CzBhmNVo0tKDI2MUaMetgowTc7LrJ","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"InvalidParameter","target":"securityProfile.securityType","message":"The value of parameter securityProfile.securityType is invalid."}]}}
ERROR: az_command_data_logger: {"status":"Failed","error":{"code":"DeploymentFailed","target":"/subscriptions/********/resourceGroups/********/providers/Microsoft.Resources/deployments/vm_deploy_Ab3CzBhmNVo0tKDI2MUaMetgowTc7LrJ","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"InvalidParameter","target":"securityProfile.securityType","message":"The value of parameter securityProfile.securityType is invalid."}]}}

Expected behavior

The VM is created, as it does in v2.70.0.

Environment Summary

azure-cli                         2.71.0

core                              2.71.0
telemetry                          1.1.0

Extensions:
image-copy-extension              0.2.13

Dependencies:
msal                            1.31.2b1
azure-mgmt-resource               23.1.1

Python location '/opt/homebrew/Cellar/azure-cli/2.71.0/libexec/bin/python'
Config directory '/Users/mboris/.azure'
Extensions directory '/Users/mboris/.azure/cliextensions'

Python (Darwin) 3.12.9 (main, Feb  4 2025, 14:38:38) [Clang 16.0.0 (clang-1600.0.26.6)]

Legal docs and information: aka.ms/AzureCliLegal


Your CLI is up-to-date.

Additional context

No response

Metadata

Metadata

Labels

Auto-AssignAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamComputeaz vm/vmss/image/disk/snapshotcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions