Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.

Reply
Jurgen
New Member

MicrosoftAzureConsumptionInsights Resource Group Tags

Hi,

 

I'm looking for a way to retrieve all of the 'Resource Group' tags, instead of those of the Azure resources.

 

Any thoughts anyone?

 

Many thanks for the assist.

 

Jurgen

7 REPLIES 7
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi Jurgen,

 

Can these two methods help? Please refer to power-bi/service-connect-to-azure-consumption-insights and power-bi/desktop-connect-azure-consumption-insights.

 

 

Best Regards,
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi,

 

First of all thank you for your reply.

 

However this doesn't work, as it only provides me the "Tags" of my "Resources", and not the "Resource Groups" :-(...

 

Any thoughts?

 

Thanks,

 

Jürgen

Hi Jürgen,

 

We have three options in the two links of my last post. Please refer to desktop-connect-azure-consumption-insights#using-the-azure-consumption-and-insights-aci-api-to-get-c...

You can get data using API. For example, rest/api/billing/enterprise/billing-enterprise-api-usage-detail.

 

 

Best Regards,
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

This is definitely the way to get consumption insights data (including Resource Tags)... but does not seem to provide any way to get at the tags of the respective parent Resource Groups.

 

I'm guessing that @Jurgen wants this so that he (like me) won't need to go through his Azure resources and apply tags to all of them just so that the Resource tags match the Resource Group tags.

 

 

Anonymous
Not applicable

Hi, i have the same use-case. Did you manage to include the Resource Groups as lines in the usage details? I'm also looking for a way to report in Power BI on Azure tags on Resource Groups, not individual resources...

I have the same question.  Has anyone found a solution?

Anonymous
Not applicable

Here's what I do ...

 

Weekly, I run a powershell script that dumps all our custom RG tags into a text file full of SQL statements.  I then run this to bulk load all our tags into an Azure SQL DB.

 

In Power BI, this DB table is joined up with the consumption data to be able to show RG tags.

 

 

#  Do this before running this script:
#  Login-AzureRmAccount

$todaysDate = Get-Date -UFormat '+%Y-%m-%d'
$results = @{}

$subscriptions=Get-AzureRMSubscription

Clear-Content c:\temp\AzureRGTags_SQLInsert_$todaysDate.sql

Add-Content c:\temp\AzureRGTags_SQLInsert_$todaysDate.sql "DELETE FROM AzureResourceGroupHistoricalPLTags WHERE DateReported = '$todaysDate';"

foreach ($vsub in $subscriptions) { 

	Select-AzureRmSubscription $vsub.SubscriptionID
	$rgs = (Get-AzureRmResourceGroup)

	foreach ($rg in $rgs) { 
		
		$ResourceGroupName=$rg.ResourceGroupName
		$SubscriptionId=$vsub.SubscriptionID
		$DateReported=$todaysDate
		$SubscriptionName=$vsub.Name
			
		if ($rg.tags -ne $null) {
			$pldepartment = $rg.tags.pldepartment
			$plclient = $rg.tags.plclient
			$plregion = $rg.tags.plregion
			$plenvironment = $rg.tags.plenvironment
			$plproduct = $rg.tags.plproduct
			$pldonotinherit = $rg.tags.pldonotinherit
			$plowner = $rg.tags.plowner
			if ($rg.tags.pldescription -ne $null) {$pldescription = $rg.tags.pldescription.Replace("'","")} else {$pldescription = 'notag'}
		} else {
			$pldepartment = ''
			$plclient = ''
			$plregion = ''
			$plenvironment = ''
			$plproduct = ''
			$pldonotinherit = ''
			$plowner = ''
			$pldescription = ''
		}
		
		Add-Content c:\temp\AzureRGTags_SQLInsert_$todaysDate.sql "INSERT INTO AzureResourceGroupHistoricalPLTags (ResourceGroupName,SubscriptionId,DateReported,SubscriptionName,pldepartment,plclient,plregion,plenvironment,plproduct,pldonotinherit,plowner,pldescription) VALUES ('$ResourceGroupName','$SubscriptionId','$DateReported','$SubscriptionName','$pldepartment','$plclient','$plregion','$plenvironment','$plproduct','$pldonotinherit','$plowner','$pldescription')"

	}
}

 

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.