An Azure service that is used to provision Windows and Linux virtual machines.
Hi Kris,
Thank you for posting your question on the Q&A portal! Let’s try to resolve this step by step in a simple way.
First, it’s important to check if those network interface cards are still somehow linked to other resources or if there’s a delay in Azure’s system updating their status. You can verify the state of the network interface cards by running the following Azure CLI command:
az network nic show --ids <NIC_ID>
If the output shows that the virtual machine reference is still there, even though the virtual machine is gone, you might need to force the removal of the reference. According to the Microsoft documentation, you can dissociate a network interface card from a virtual machine even if the virtual machine is deleted, but sometimes manual intervention is needed. Here’s the link to the official guide on managing network interfaces in Azure: Microsoft Docs - Manage network interfaces.
Another thing you can try is using Azure PowerShell to remove the virtual machine reference forcefully. Here’s a simple command that might help:
$nic = Get-AzNetworkInterface -Name <NIC_Name> -ResourceGroupName <ResourceGroup_Name>
$nic.VirtualMachine = $null
Set-AzNetworkInterface -NetworkInterface $nic
After running this, wait a few minutes and check if the network interface card is now free from the virtual machine reference. If it still doesn’t work, sometimes deleting the network interface card directly through the Azure portal by navigating to the resource and selecting "Delete" can bypass the issue, as long as no other dependencies are blocking it.
If none of these steps work, it might be worth checking if there are any locks or policies preventing the deletion. You can review resource locks in the Azure portal under the "Locks" section of the resource group. More details on managing locks can be found here: Microsoft Docs - Manage resource locks.
Let me know if you still run into trouble.
Best regards,
Alex
P.S. If my answer help to you, please Accept my answer
PPS That is my Answer and not a Comment
https://ctrlaltdel.blog/