Not able to delete Azure lab services

Simran Kaur 0 Reputation points Microsoft Employee
2024-08-22T22:36:34.2833333+00:00

I am getting this while trying to delete my azure labs. Has anyone seen this?

status": "Failed",

 "errorCode": "JobTimeout",

 "errorMessage": "The operation could not be completed within the allotted time.",

 "requestUri": "https://ml-row2-rp.ml.vsdth.visualstudio.com/subscriptions/6/resourceGroups//providers/Microsoft.LabServices/labaccounts/?api-version=2019-01-01-preview",

 "httpMethod": "DELETE",

 "operationUrl": "https://management.azure.com/subscriptions/providers/Microsoft.LabServices/locations/westeurope/operations/api-version=2019-01-01-preview"

}

Azure Lab Services
Azure Lab Services
An Azure service that is used to set up labs for classrooms, trials, development and testing, and other scenarios.
300 questions
{count} votes

2 answers

Sort by: Most helpful
  1. hossein jalilian 9,465 Reputation points
    2024-08-22T23:09:57.71+00:00

    Thanks for posting your question in the Microsoft Q&A forum.

    Ensure that there are no dependencies or resources associated with the lab that might be preventing its deletion. You might need to manually delete or detach any resources or configurations associated with the lab before you can delete the lab itself.

    Make sure that the resource you’re trying to delete is in a state that allows deletion. If the resource is in a transitional state or is being used by another process, it might not be able to be deleted.

    Retrying the delete operation after a short period can resolve the issue.


    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful


  2. anashetty 1,150 Reputation points Microsoft Vendor
    2024-08-27T10:09:13.3+00:00

    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://zcusa.951200.xyz/en-us/azure/devtest-labs/devtest-lab-delete-lab-vm and https://zcusa.951200.xyz/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."


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.