Cannot delete VMs and RG

Manuel T 1 Reputation point
2021-04-28T06:56:24.963+00:00

I created a resource group + VMs + availability set using Terraform.
Now, I cannot delete the resources.

Remove-AzureRmVM -ResourceGroupName $myResourceGroup -Name $myVM

This command returns:

Remove-AzVM: Long running operation failed with status 'Failed'. Additional Info:'An unexpected error occured while processing the network profile of the VM. Please retry later.'
ErrorCode: NetworkingInternalOperationError
ErrorMessage: An unexpected error occured while processing the network profile of the VM. Please retry later.
ErrorTarget:
StartTime: 4/28/2021 6:38:52 AM
EndTime: 4/28/2021 6:38:52 AM
OperationID: b3c4f11d-5e26-499f-bd56-a9a77d8da0d6
Status: Failed

az vm delete --resource-group $myResourceGroup --name $myVM command returns the same error.

Trying to delete the whole resource group with az group delete --name $myResourceGroup returns

Deployment failed. Correlation ID: 05b6eed6-839b-4327-b5d4-81c275374062. Operation failed with status: 'Conflict'. Details: 409 Client Error: Conflict for url: https://management.azure.com/subscriptions/7d22226c-9d23-4835-b2aa-efe5f5219159/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1SRzoyRERFVk9QUzoyRFBST0pFQ1QxLVdFU1RFVVJPUEUiLCJqb2JMb2NhdGlvbiI6Indlc3RldXJvcGUifQ?api-version=2020-10-01

It's been 12 hours and I don't know what that conflict is.
What can I do to delete the rg?

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
8,228 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Divyesh Govaerdhanan 485 Reputation points
    2024-12-26T18:06:02.3166667+00:00

    Hello,

    Welcome to Microsoft Q&A,

    1. Check for the VM dependencies
    2. Delete the dependent resources before deleting the VM like NICs, Public IP, Disk, Load balancers or other network resources.
    3. Remove resource locks

    Please Upvote and accept the answer if it helps.

    0 comments No comments

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.