1

I've created a kusto query that will allow me to have an overview of all resourceGroups:

resourcecontainers
where type == 'microsoft.resources/subscriptions/resourcegroups'
project subscriptionId, resourceGroup,  tags.mytag1, tags.mytag2, tags.mytag3

Is there a way I can project the subscriptionName instead of the subscriptionId?

the goal is to make it more human readable.

Francesco Mantovani
  • 10,216
  • 13
  • 73
  • 113

1 Answers1

2

Sure, that is possible by joining on the resourcecontainers of type microsoft.resources/subscriptions:

resourcecontainers
| where type == 'microsoft.resources/subscriptions' 
| project subscriptionId, subscriptionName = name 
| join (resourcecontainers 
    | where type == 'microsoft.resources/subscriptions/resourcegroups') 
    on subscriptionId 
| project subscriptionName, resourceGroup, tags.mytag1, tags.mytag2, tags.mytag3
Francesco Mantovani
  • 10,216
  • 13
  • 73
  • 113
Peter Bons
  • 26,826
  • 4
  • 50
  • 74