Deletion of VM

Glenn Maxwell 11,496 Reputation points
2020-05-03T00:59:15.347+00:00

Hi Experts, i am new to azure
What is the best practice to delete a virtual machine from Azure, let say i have a virtual machine server01, when i click All Resources- when i type Server01, i can see i can see virtual machine(server01), network interface(server01-NIC), network security group(server01-nsg), public ip address(server01-public-ip), disks(server01-OS,server01-disk01) . but how can i know if any disk is mapped to other VM or this security group is used by other VM, or this NIC is binded with other VM. when deleting i want to make sure i am deleting this VM without impacting any other VM.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,991 questions
{count} votes

Accepted answer
  1. Leon Laude 85,816 Reputation points
    2020-05-03T07:57:54.7+00:00

    Hi,

    The following blog post goes through the deletion of an Azure VM and cleanup steps with PowerShell:
    How to Remove an Azure Virtual Machine and Cleanup with PowerShell

    The following script can also find and delete unattached Azure disks:
    Find and delete unattached Azure managed and unmanaged disks

    The Azure VM deletion is also a process that is being improved, see the uservoice here:
    https://feedback.azure.com/forums/216843-virtual-machines/suggestions/8945692-delete-vm-with-all-associated-resources

    (Please don't forget to mark helpful replies as answer)

    Best regards,
    Leon

    2 people found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Manu Philip 18,676 Reputation points MVP
    2020-05-29T22:15:43.477+00:00

    My script here in the following link can solve this
    http://cloudcompute.info/delete-azure-vm-and-all-associated-resources-using-powershell-script/

    Thanks,
    Manu

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.