I would like to retrieve all the resource group names with their corresponding tags and values to show them as a report, like this
I have tried queries to split the tags into columns without success.
Can anyone please help me?
To retrieve all the resource group names with their corresponding tags and values to show them as a report you can use extend
, by using this fields
can be taken which are present in tags, CreatedBy is a field stored in tags and name the field in the way to be viewed in the report. createdBy is name of the field this can be called by using [tags].<field name in tags>
. So, the Tags can be separated into columns.
Below query is used to separate tags into columns:
resources
| project
subscriptionId,
resourceGroup,
name,
type,
tags
| extend
createdBy = ['tags'].CreatedBy,
createdDate = ['tags'].CreatedDate,
owningTeam = ['tags'].OwningTeam,
reason = ['tags'].Reason
Output: