We need to export and setup custom dashboard the resource inventory list

Robin Hitch 165 Reputation points
2024-11-29T06:27:45.4066667+00:00

Hi

We need to export and setup custom dashboard the Asset inventory details like Computer Name, Username, Domain, RAM, CPU, HDD drive size with utilization, Last boot time, Uptime, IP & Subnet address, OS & build version, Laptop/Desktop, Physical/Virtual.

This requirement applies to both Azure ARC-enabled servers and Azure Virtual Machines, please help to setup the custom dashboard and to export the instance details.

Please help how can we achieve this using Azure resources

Thanks in advance.

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,363 questions
0 comments No comments
{count} votes

Accepted answer
  1. Ashok Gandhi Kotnana 1,185 Reputation points Microsoft Vendor
    2024-11-29T07:56:04.4766667+00:00

    Hi Robin Hitch

    Welcome to Microsoft Q&A Forum, thank you for posting your query here!

    Please use "Azure Resource Graph Explorer" to fetch this data.
    Please find the below screenshot of the output for your reference
    User's image

    You can also pin this to the dashboard once the results have been populated
    User's image

    Below is the sample code you need to modify the code based upon the requirement

    Resources
    | where type in ("microsoft.compute/virtualmachines", "microsoft.hybridcompute/machines")
    | extend ComputerName = name
    | extend vmSize = properties.hardwareProfile.vmSize
    | extend RAM = tostring(properties.hardwareProfile.vmSizeProperties.memoryInMB / 1024) // Convert to GB
    | extend CPU = tostring(properties.hardwareProfile.vmSizeProperties.vCPUsAvailable)
    | extend osDiskSize = tostring(properties.storageProfile.osDisk.diskSizeGB)
    | extend osType = properties.storageProfile.osDisk.osType
    | extend isArcEnabled = type == "microsoft.hybridcompute/machines"
    | extend OSVersion = properties.extended.instanceView.osVersion
    | extend VMType = iif(isArcEnabled, "Hybrid (Arc)", "Azure VM")
    | project ComputerName, vmSize, RAM, CPU, osDiskSize, osType, OSVersion, VMType, location
    

    For Azure Arc machines you use this below reference document to fetch the data
    Refer: https://learn.microsoft.com/en-us/azure/azure-arc/servers/resource-graph-samples?tabs=azure-cli
    MS document for Azure Virtual Machine
    Refer: https://learn.microsoft.com/en-us/azure/virtual-machines/resource-graph-samples?tabs=azure-cli

    Above are the links which has the sample codes and example so that you can refer it and make use of it.
    let us know if any help, we will always help as you needed.! Please provide your valuable feedback

    User's image

    Please do not forget to "Accept the answer” wherever the information provided helps you, this can be beneficial to other community members.


0 additional answers

Sort by: Most helpful

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.