How to delete a Network Interface which is attached to a deleted VM?

Dayala Badrinadh Reddy 0 Reputation points
2024-02-15T07:28:35.15+00:00

We are unable to delete two Network Interfaces (NICs) that are associated to virtual machines that don't exist anymore. We are not sure how this happened but the VMs these NICs are associated with seems to be deleted.

So, when we delete the NICs we are getting the below error:

"Failed to delete network interface 'aadds-3ad4f5d2ca9d4b0e9769d59603dafc8f-nic'. Error: Network Interface aadds-3ad4f5d2ca9d4b0e9769d59603dafc8f-nic is used by existing resource Cust-e-x-p-l-e-o-0-o-n-m-i-0f52d03f-d8ad-466a-a343-55adfcb48c2e/providers/Microsoft.Compute/virtualMachines/RQUROEG4ZLU1WRX.5193b551. In order to delete the network interface, it must be dissociated from the resource. To learn more, see aka.ms/deletenic."

As suggested in this post, we also tried deleting the Domain Service, but it fails with an error saying "Please check Activity log for more detail.". Summary message of that activity says "The resource operation completed with terminal provisioning state 'Failed'.".

We have already checked these things :

  • VMs don't exist for sure.
  • Resource Group of deleted VMs also doesn't exist.
  • Unable to delete Virtual Network "aadds-vnet" because of the connected NICs.
  • Deleting the NICs using "https://resources.azure.com" also threw the same error.
  • Unable to modify IP Configurations of these VMs.
  • PowerShell commands aren't helping. They fail with same error. Please suggest how we can remove the network interface or delete the entire Domain Service.
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.
2,268 questions
{count} votes

2 answers

Sort by: Most helpful
  1. GitaraniSharma-MSFT 49,261 Reputation points Microsoft Employee
    2024-03-04T12:34:33.8166667+00:00

    Hello @Dayala Badrinadh Reddy ,

    I understand that you were unable to delete a Network Interface which is attached to a deleted VM.

    To delete the orphaned NIC, a support request is needed so that the support team can remove it from the backend.

    As you've a free trial subscription, we enabled a one-time free technical support for your subscription, and you created a support request for this issue.

    I tracked the case from my end and found that you were to solve the issue and successfully deleted the resources. And currently are in discussion with the billing team for some additional follow-up questions.

    Kindly let us know if 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.

  2. Jackson Martins 10,126 Reputation points MVP
    2024-02-15T07:59:17.49+00:00

    HI @Dayala Badrinadh Reddy You can try using the -Force parameter in the Azure CLI

    az network nic delete --name <NIC-Name> --resource-group <Resource-Group-Name>
    

    Force Removel

    Remove-AzNetworkInterface -Name <NIC-Name> -Force
    

    Or you can try to locate and delete the ghost nics, just like:

    Get-AzNetworkInterface | where-object { $_.VirtualMachine -eq $null } | ft name
    Get-AzNetworkInterface | where-object { $_.VirtualMachine -eq $null } | Remove-AzNetworkInterface -Force
    

    reference answer: https://video2.skills-academy.com/en-us/answers/questions/304119/cant-delete-a-network-interface-in-azure-there-is

    If the above methods do not resolve the issue, the most direct way to address this problem is by opening a support ticket with Microsoft Azure. Azure support has more direct access to backend systems and can often resolve these kinds of "stuck" resource issues. Given the complexity and the potential need for backend intervention, Azure support would be able to assist more effectively.

    Reference: https://github.com/MicrosoftDocs/azure-docs/issues/29959

    Get in touch if you need more help with this issue.
    --please don't forget to "[Accept the answer]" if the reply is helpful--