Ability to retreive subscription name given subscriptionId in Resource Graph Query
Resource graph queries are great at returning SubscriptionId. But a GUID is unfriendly. Provide a function or means for retrieving the subscription display name. For example:
where type contains 'publicIPAddresses' and properties.ipAddress != ''
| summarize count () by subscriptionName(subscriptionId)
This is now available in PowerShell and Azure CLI. Please find the example in our documentation:
We are now working to make this available through API.
Navi Aujla commented
Search-AzGraph -Include DisplayNames -Query "where type contains 'publicIPAddresses' and isnotempty(properties.ipAddress) | project subscriptionDisplayName, subscriptionId, name, properties.ipAddress, location, resourceGroup, properties.publicIPAllocationMethod" | ft
Stephane Lapointe commented
Today I get the query results in PowerShell to perform that lookup and add the info to the resultset.
Chirag Gupta commented
We are looking at supporting Subscription as an object in Azure Resource Graph and will get back how to expose it in most appropriate way.