How to solve "Failed to delete network interface" when VM is already deleted

Doktor01 20 Reputation points
2025-11-20T12:23:55.15+00:00

Customer ran into error with Failed to delete network interface.

Details: Failed to delete network interface 'aadds-695c159972c24d4aa45dadbe85b983d2-nic'.

Error: Network Interface /subscriptions/6c2ea9b7-3...-4d.-9762-30950f./resourceGroups/xxxxxxx/providers/Microsoft.Network/networkInterfaces/aadds-695c159972c24d4aa45dadbe85b983d2-nic

is used by existing resource /subscriptions//resourceGroups/Cust-H-o-m-e-b-a-s-e--287a4d5d-6175-4efe-a094-98fd6bfa10b5/providers/Microsoft.Compute/virtualMachines/Z09BI5F5D5OQ2PT.92d580d8.

In order to delete the network interface, it must be dissociated from the resource. To learn more, see aka.ms/deletenic..

Customer ran into error with Failed to delete network interface.

Details: Failed to delete network interface 'aadds-feb8c58a50f04ca9a448b1868d827379-nic'.

Error: Network Interface /subscriptions/6c2ea9b7-3...-4d..-9762-30950f./resourceGroups/xxxxxxxx/providers/Microsoft.Network/networkInterfaces/aadds-695c159972c24d4aa45dadbe85b983d2-nic

is used by existing resource /subscriptions/6c2ea9b7-3...-4d..-9762-30950f./resourceGroups/Cust-H-o-m-e-b-a-s-e--287a4d5d-6175-4efe-a094-98fd6bfa10b5/providers/Microsoft.Compute/virtualMachines/Z09BI5F5D5OQ2PT.92d580d8.

In order to delete the network interface, it must be dissociated from the resource.

To learn more, see aka.ms/deletenic..

az network nic delete --resource-group -nic ( Has error results )

(NicInUse) Network Interface /subscriptions/6c2ea9b7-3061-4d55-9762-30950f4c0481/resourceGroups/......./providers/Microsoft.Network/networkInterfaces/aadds-feb8c58a50f04ca9a448b1868d827379-nic is used by existing resource /subscriptions/6c2ea9b7-3.-4...-9762-30950f./resourceGroups/Cust-H-o-m-e-b-a-s-e--287a4d5d-6175-4efe-a094-98fd6bfa10b5/providers/Microsoft.Compute/virtualMachines/JG8WBKTR5X6MTMM.92d580d8. In order to delete the network interface, it must be dissociated from the resource. To learn more, see aka.ms/deletenic.

Code: NicInUse

Message: Network Interface /subscriptions/6c2ea9b7-3061-4d55-9762-30950f4c0481/resourceGroups/........./providers/Microsoft.Network/networkInterfaces/aadds-feb8c58a50f04ca9a448b1868d827379-nic is used by existing resource /subscriptions/6c2ea9b7-3.-4d..9762-30950f./resourceGroups/Cust-H-o-m-e-b-a-s-e--287a4d5d-6175-4efe-a094-98fd6bfa10b5/providers/Microsoft.Compute/virtualMachines/JG8WBKTR5X6MTMM.92d580d8. In order to delete the network interface, it must be dissociated from the resource. To learn more, see aka.ms/deletenic.

The Vm's are already deleted

Azure Virtual Network
Azure Virtual Network
An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
{count} votes

Answer accepted by question author
  1. Vallepu Venkateswarlu 1,235 Reputation points Microsoft External Staff Moderator
    2025-11-20T12:40:42.87+00:00

    Hi @Doktor01,

    Welcome to Microsoft Q&A Platform. Thank you for reaching out & hope you are doing well.

    Please check if there are any dependencies for the Azure VM by navigating to the Resource Group in the portal. Delete the dependent resources one by one, and then try deleting the NIC. Also, if a Microsoft Entra Domain Service is configured and not in use, please delete it as well.

    User's image

    $nic = Get-AzNetworkInterface -Name <NIC_Name> -ResourceGroupName <ResourceGroup_Name>    $nic.VirtualMachine = $null    
    Set-AzNetworkInterface -NetworkInterface $nic
    
    

    After running the above command, wait for 10 minutes and then try deleting the network card using the command below.

    az network nic delete -g MyResourceGroup -n MyNic
    

    If the above steps don’t work, try creating a new virtual machine (VM) with the same name, in the same resource group and location. Then attach the old NIC to the new VM and delete the VM.

    Kindly let us know if the above helps or you need further assistance on this issue.

     

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Q&A Assist
    2025-11-20T12:24:18.3233333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    To resolve the "Failed to delete network interface" error when the virtual machine (VM) has already been deleted, you need to ensure that the network interface (NIC) is not still associated with any resources. Here are the steps to troubleshoot and resolve the issue:

    1. Check for Remaining Resources: Even if the VM is deleted, there might be other resources that are still using the NIC. You should check if there are any existing resources that are still linked to the NIC, such as load balancers or other VMs.
    2. Detach the Network Interface: If the NIC is still associated with any resource, you need to detach it. Since the VM is deleted, you can use the Azure CLI or PowerShell commands to remove the NIC from any remaining associations:
      • Azure CLI: Use the command az network nic delete --name <NIC_NAME> --resource-group <RESOURCE_GROUP_NAME> to delete the NIC directly if it is not in use by any other resource.
      • PowerShell: Use Remove-AzNetworkInterface -Name <NIC_NAME> -ResourceGroupName <RESOURCE_GROUP_NAME> to remove the NIC.
    3. Force Delete (if necessary): If the NIC is still reported as in use and you are unable to delete it through normal means, you may need to check Azure support or forums for further assistance, as there could be a backend issue preventing the deletion.
    4. Check Azure Portal: You can also go to the Azure portal and manually check the status of the NIC and any associated resources. Navigate to the NIC and see if there are any dependencies listed.

    If you follow these steps and still encounter issues, consider reaching out to Azure support for further assistance.


    References:

    0 comments No comments

Your answer

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