Virtual machine associated resources

Az Cloud Learner 71 Reputation points
2020-09-21T13:42:06.25+00:00

Hello Team,

I am looking for easy method to list of virtual machine's associated all resources,
Ex : on vm1, I would like to know associated NSG,ASG, OSDisk, Data disks, Subnet, vNet, NSG, Load Balancer, Associated storage account (for Diag settings),

Thank you.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
8,019 questions
0 comments No comments
{count} vote

2 answers

Sort by: Most helpful
  1. Manu Philip 18,681 Reputation points MVP
    2020-09-21T15:04:20.193+00:00

    I have created a TechNet wiki article to delete all the associated VM resources. I suggest you to adopt the code and change it as per your requirement. You may comment the code which deletes the resources. Following is the link
    53980.azure-delete-vm-and-all-associated-resources-using-powershell-script.aspx

    0 comments No comments

  2. KarishmaTiwari-MSFT 20,212 Reputation points Microsoft Employee
    2020-09-29T01:32:10.9+00:00

    Please follow these guides to delete the associated resources with VM:

    1. Remove NIC from VM
    2. Remove disks from Azure VM

    Let me know if you are interested in a specific associated resource.

    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.