Share via

Can't remove resources

Johan Somers 1 Reputation point
2021-04-26T13:49:17.04+00:00

I want to clean up our azure and remove the virtual network, because we don't use it anymore, but i keep getting messages that I can't delete the resource because another resource is linked to it, but the final resource is a Virtual machine with resource number JQHOZW0ZBGRMGCP.7d34569e witch Azure cannot find

Azure Virtual Machines
Azure Virtual Machines

An Azure service that is used to provision Windows and Linux virtual machines.

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

1 answer

Sort by: Most helpful
  1. suvasara-MSFT 10,166 Reputation points Moderator
    2021-04-26T14:57:54.977+00:00

    @Johan Somers , 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?

    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.