-
Notifications
You must be signed in to change notification settings - Fork 3.4k
az lab vm delete command not working azure pipelines #30446
Copy link
Copy link
Open
Labels
Auto-AssignAuto assign by botAuto assign by botAuto-ResolveAuto resolve by botAuto resolve by botDevtestlabaz labaz labService AttentionThis issue is responsible by Azure service team.This issue is responsible by Azure service team.Similar-Issueact-codegen-extensibility-squadbugThis issue requires a change to an existing behavior in the product in order to be resolved.This 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.Issues that are reported by GitHub users external to the Azure organization.
Metadata
Metadata
Assignees
Labels
Auto-AssignAuto assign by botAuto assign by botAuto-ResolveAuto resolve by botAuto resolve by botDevtestlabaz labaz labService AttentionThis issue is responsible by Azure service team.This issue is responsible by Azure service team.Similar-Issueact-codegen-extensibility-squadbugThis issue requires a change to an existing behavior in the product in order to be resolved.This 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.Issues that are reported by GitHub users external to the Azure organization.
Describe the bug
We provision VM's in DevTestLabs for testing purposes and delete the VM's once tests are ran.
Recently the command 'az lab vm delete' is not working when ran from an azure pipelines task. This seems to be an issue when using AzureCLI@2 task and also, we tried running from a PowerShell task which resulted in same error.
However, when we run the command from a cloud shell in portal it works fine.
This was working fine for the past year. Only the last month we are seeing this issue.
Related command
az lab vm delete
Errors
When I add the
--yes -yflag the VM's get the deleted but the error is still thrown.Without
--yes -ythe VM's are NOT deleted.when running to following:
##[error]Delete VM failed: DEBUG: cli.knack.cli: Command arguments: ['lab', 'vm', 'delete', '--name', 'vm1', '--resource-group', 'rg-devtestlabs', '--lab-name', 'DevTestLab', '--yes', '-y', '--debug']
DEBUG: cli.knack.cli: Command arguments: ['lab', 'vm', 'delete', '--name', 'vm1', '--resource-group', 'rg-devtestlabs', '--lab-name', 'DevTestLab', '--yes', '-y', '--debug']
Without
--debug##[error]Delete VM failed: WARNING: This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
WARNING: This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
when running to following:
##[error]Delete VM failed: ERROR: Operation cancelled.
ERROR: Operation cancelled.
Issue script & Debug output
az lab vm delete
--name $($vmName)--resource-group $(DevTestLabs.ResourceGroupName)
--lab-name $(DevTestLabs.LabName)Expected behavior
vms in DevTestLab should be deleted successfully
Environment Summary
azure-cli 2.66.0
core 2.66.0
telemetry 1.1.0
Extensions:
azure-devops 1.0.1
Dependencies:
msal 1.31.0
azure-mgmt-resource 23.1.1
Python location '/opt/az/bin/python3'
Extensions directory '/opt/az/azcliextensions'
Python (Linux) 3.12.7 (main, Oct 30 2024, 03:56:40) [GCC 11.4.0]
Additional context
No response