Azure resource graph query

MrFlinstone 651 Reputation points
2025-02-26T23:00:53.96+00:00

I have got the query below which retrieves disk information using Azure resource graph, I would like to extract information on managed disks, blob storage accounts and files without a backup policy configured for them.

Would it also be possible to convert the resource graph query into native powershell ?

Resources
| where type == "microsoft.compute/disks"
| project diskName=name, diskSizeGB=properties.diskSizeGB, diskSKU=sku.name, encryptionType=properties.encryption.type, diskState=properties.diskState


Azure Advisor
Azure Advisor
An Azure personalized recommendation engine that helps users follow best practices to optimize Azure deployments.
82 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Stanislav Zhelyazkov 26,361 Reputation points MVP
    2025-02-27T07:08:42.5466667+00:00

    Hi,

    There is no automatic way to convert the query to PowerShell command but what stops you from executing the query via PowerShell? Other option if you want to get the data from Azure Disk is to run Get-AzDisk. Running arg queries is faster in scale as you can run it against multiple subscriptions and ARG executes faster. Get-AzDisk have to be ran by subscription and uses the Rest API which is slower than ARG.

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    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.