I created an interactive Azure Workbook where I use the option 'When items are selected, export parameters' to passthrough the selection to a Detail grid in another part of the workbook. for example: I select an Azure Region on the map and the resources in that region are shown in the Detail grid. So far so good.
The issue I haven't yet resolved is that when no selection is made (on initial opening the workbook) the parameter is empty and the query returns an error.
"Query is invalid. Please refer to the documentation for the Azure Resource Graph service and fix the error before retrying. ParserFailure..."
Can anybody help me with a solution?
The query looks like this, where {SelectedLocations} is the parameter passthrough from another part of the Workbook:
resources
| where location in ({SelectedLocations})
| join kind=inner (
resourcecontainers
| where type == 'microsoft.resources/subscriptions'
| project subscriptionId, subscriptionName = name
) on subscriptionId
| extend details = pack_all()
| project id, type, location, subscriptionName, details
| order by location
As soon as the {SelectedLocations} has a value the query returns desired results.