Hi Simran Kaur,
Thanks for getting back with us, we understand that you are still facing the issue, we will provide you with more details to help you resolve it! Here are some additional suggestions you can try.
You can unstuck Delete operation by using Azure portal: Go to Resource Group in the Azure Portal, Find the resource that is stuck in the "Deleting" state. Look for an option to Cancel the delete operation.
Try using the --no-wait flag to avoid waiting for the operation to complete synchronously: az lab delete --resource-group <YourResourceGroupName> --name <YourLabAccountName> --no-wait
Make sure that the resource group name, lab account name, and other relevant details are correct and accurate.
You can use the Azure REST API to forcefully delete the resource. Here’s how to send a DELETE request: curl -X DELETE -H "Authorization: Bearer <your_access_token>" \ "https://management.azure.com/subscriptions/<your_subscription_id>/resourceGroups/<YourResourceGroupName>/providers/Microsoft.LabServices/labaccounts/<YourLabAccountName>?api-version=2019-01-01-preview"
Make sure you replace <your_access_token>, <your_subscription_id>, <YourResourceGroupName>, and <YourLabAccountName> with your actual values. To get Access token use command: az account get-access-token --query accessToken --output tsv
You can also delete Lab by using Azure portal.
Here are the links for detail steps to delete Lab by using Azure portal.
https://learn.microsoft.com/en-us/azure/devtest-labs/devtest-lab-delete-lab-vm and https://learn.microsoft.com/en-us/azure/lab-services/manage-labs
We noticed that you rated an answer as not helpful. I have provided an answer with the relevant details to make this a positive experience for you. Thanks!
If you have any further queries, please do let us know.
If the answer is helpful, please click "Accept Answer" and "Upvote it."