I'm trying to create a Workbook Parameter drop down, where we can choose Subscription to filter.
However, 1 Tenant/ Directory might have one or more subscriptions.
Instead of a flat subscription drop-down list like this:,
Is there a way to create a drop-down list of subscription grouped by Tenant/Directory similar to the ones in Azure Resource Graph Explorer page (located in the right side) like this:?
Tenant 1
Tenant 2
Tenant 3
Thank you very much for your help.
A partial solution:
ResourceContainers | where type =~ "microsoft.resources/subscriptions"
// add any other filters you want here
| project id, name, group=tenantId
you'll get a dropdown parameter that is subs grouped by tenant.
limitation: Azure Resource Graph doesn't have tenant names (not sure why), so the dropdown itself won't have those. you'd possibly have to query ARM separately to get all the tenants by name+id and merge with that if you want tenant names?
Update: Jason went the extra step of using merge to get data, which i'm not sure why i didn't think of that.
you could possibly use the ARM data source and query the /tenants api to get that info to use in the merge:
in my place i'm only getting on tenant back in that list, though, so i can't verify that it will work and get you all the tenants. i swear i have access to more than one but i'm only getting back my primary one?