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.

0 comments No comments

Answer accepted by question author
suvasara-MSFT 10,171 Reputation points Moderator
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.

Was this answer helpful?

1 person found this answer helpful.
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.

    Was this answer helpful?

    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.