Skip to content

--source-vm-id parameter from az lab custom-image create always throw InvalidArgumentValue #30232

@ggorge-me

Description

@ggorge-me

Describe the bug

When attempting to create a custom image in Azure DevTest Labs using the Azure CLI, the following error is returned:

ERROR: InvalidArgumentValue: --source-vm-id: Invalid format: resource id should be in '/subscriptions/{}/resourcegroups/{}/providers/microsoft.devtestlab/labs/{}/virtualmachines/{}' format.

This occurs despite the --source-vm-id being provided in the expected format, as shown in the command below. The command does not execute successfully and fails due to an apparent validation issue with the provided source-vm-id format.

Related command

az lab custom-image create

Errors

ERROR: InvalidArgumentValue: --source-vm-id: Invalid format: resource id should be in '/subscriptions/{}/resourcegroups/{}/providers/microsoft.devtestlab/labs/{}/virtualmachines/{}' format.

Issue script & Debug output

$ az lab custom-image create --lab-name myLab \
>                            --name image-1 \
>                            --os-state NonDeprovisioned \
>                            --os-type Linux \
>                            --resource-group myRg \
>                            --source-vm-id /subscriptions/<real_subscription_id_here>/resourcegroups/myRg/providers/microsoft.devtestlab/labs/MyLab/virtualmachines/tmp-1730362420

WARNING: This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
ERROR: InvalidArgumentValue: --source-vm-id: Invalid format: resource id should be in '/subscriptions/{}/resourcegroups/{}/providers/microsoft.devtestlab/labs/{}/virtualmachines/{}' format.

Expected behavior

I'm expecting that the custom image is created in the DevTestLab.

Environment Summary

$ az version
{
  "azure-cli": "2.65.0",
  "azure-cli-core": "2.65.0",
  "azure-cli-telemetry": "1.1.0",
  "extensions": {
    "account": "0.2.5"
  }
}

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Auto-AssignAuto assign by botDevtestlabaz labService AttentionThis issue is responsible by Azure service team.act-codegen-extensibility-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.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions