Cant delete a network interface in Azure. There is no vm behind this network interface.

Lubenz007 21 Reputation points
2021-03-08T16:11:14.023+00:00

Cant delete a network interface in Azure. There is no vm behind this network interface. Failed to delete network interface 'TD43QOZ2A3GO-U0Nic'. Error: Network Interface TD43QOZ2A3GO-U0Nic is used by existing resource /providers/Microsoft.Compute/virtualMachines/TD43QOZ2A3GO-U0.e97acff9. In order to delete the network interface, it must be dissociated from the resource. To learn more, see aka.ms/deletenic.

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,312 questions
0 comments No comments
{count} votes

Accepted answer
  1. suvasara-MSFT 10,036 Reputation points
    2021-03-09T06:59:07.897+00:00

    @Lubenz007 , please go through this similar ask answered by me. Here are the commands to delete those ghosted nics,

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

    ----------

    Please do not forget to "Accept the answer" wherever the information provided helps you to help others in the community.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Lubenz007 21 Reputation points
    2021-03-12T14:12:17.23+00:00

    Thank you.
    That worked.

    0 comments No comments