Export Azure VM Info

Irakli 0 Reputation points
2024-10-02T10:26:51.31+00:00

Hello,

I would like to export list of virtual machines & their corresponding: Name, IP, Type (Windows or Linux for example), CPU, RAM, HDD\SSD and Tag

As I know it is possible with Azure Resource Graph, but when I tried applied filters I cant see anything... How do I should write script correct?

Thanks in advance.

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

1 answer

Sort by: Most helpful
  1. Irakli 0 Reputation points
    2024-10-02T12:31:33.96+00:00

    Resources

    | where type == 'microsoft.compute/virtualmachines'

    | extend

    OSName = tostring(properties.osProfile.computerName),

    OSType = tostring(properties.storageProfile.osDisk.osType),

    VMSize = tostring(properties.hardwareProfile.vmSize)

    | join kind=leftouter

    ( Resources

    | where type =~ 'microsoft.network/networkinterfaces'

    not sure what is the next and how to select cpu\ram...


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.