The problem: https://community.grafana.com/t/integration-with-azure-metrics-variables-not-getting-full-scope/43216 This is part of a litte workaround on using Azure Metrics with Grafana.
You currently simply cannot fected the resources_groups from the KSL on the variables scope. (please tell me if you can)
So This script uses an Azure Subscription ID and pull the data into a sqlite database. From there using the sqlite plugin you can query them.
Examples of variables
Listing the resource groups
SELECT DISTINCT(resource_group) FROM virtual_machines:
Listing the virtual machine withing the previous resource groups
SELECT name FROM virtual_machines WHERE resource_group=$resource_group;