In my azure portal I have 6 separate applications, I have to list all of the employed resources using Azure Resource Graph query, but some of the applications' resources have no app_id tag. Therefore, when I filter the query based on app_id tag, the result of the query does not retrieve all of the resources. For example, if I have total 100 resources in those 6 applications, it brings 80 of them which have app_id tag. In this case, my question is that what would be the best approach to bring all of the resources belonging my applications using Azure Resource Graph query.
Additionally, I thought one possible way to get this output would be joining resource groups of all those applications based on app_id filter since when I filter only the resource group names in the query, it brings the desired output but, the issue is some applications may have multiple resource groups while some only one. At this point, I also would love to receive your feedback regarding how can I write this query/clause/condition to filter respective resource groups based on app_id tag, then take every resource from within this resource groups?
You can union queries as below. Also i highly suggest to add Tags when you create the resources (or after). Tags are useful for tracking resources without any boundries. You can create an application tag and assign it to multiple resources or create appname1 and appname2 tag to assing multiple application to one resource. After you tagged resources you can query them by tag. Without changing resource groups.