Hello Tim Jin,
We should build the query with the help of ElasticsanResources table as per the below screenshot.
Reference Document:
Understand the query language - Azure Resource Graph | Microsoft Learn
Try using the below query and see if it helps.
Search-AzGraph -Query "ElasticsanResources | where type == 'microsoft.elasticsan/elasticsans/volumegroups' | project Subscription= subscriptionId, name, location, resourceGroup,id"
If it doesn’t help make sure you have created the volumes. Below is the reference document on how to create.
az elastic-san volume-group | Microsoft Learn
and If you found the comment/answer helpful, please consider clicking "Upvote it/accept the answer".
Thank You,
Siva shunmugam.