<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Resource Tag</title>
	<atom:link href="https://www.armandit.com/tag/resource-tag/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.armandit.com</link>
	<description></description>
	<lastBuildDate>Sun, 23 Mar 2025 22:08:33 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.5</generator>
	<item>
		<title>Export Azure Resource Tags</title>
		<link>https://www.armandit.com/2025/03/21/export-azure-resource-tags/</link>
					<comments>https://www.armandit.com/2025/03/21/export-azure-resource-tags/#respond</comments>
		
		<dc:creator><![CDATA[Armand Hatting]]></dc:creator>
		<pubDate>Fri, 21 Mar 2025 21:03:49 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Azure Resource Tags]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Resource Tag]]></category>
		<category><![CDATA[Tag]]></category>
		<category><![CDATA[Tags]]></category>
		<guid isPermaLink="false">https://www.armandit.com/?p=446</guid>

					<description><![CDATA[Export Azure Resource Tags One of Microsoft&#8217;s best practices is to ensure to add Tags (which are key:value pairs) to resources for accurate ownership tracking and cost management. Whether you apply tags to management groups, subscriptions, resource groups or resources, this ensures you can easily create reports based on these tags. However, the accuracy of [&#8230;]]]></description>
										<content:encoded><![CDATA[		<div data-elementor-type="wp-post" data-elementor-id="446" class="elementor elementor-446">
				<div class="elementor-element elementor-element-7b38a66 e-flex e-con-boxed e-con e-parent" data-id="7b38a66" data-element_type="container" data-e-type="container">
					<div class="e-con-inner">
				<div class="elementor-element elementor-element-76802f69 elementor-widget elementor-widget-text-editor" data-id="76802f69" data-element_type="widget" data-e-type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
									<h3><strong>Export Azure Resource Tags</strong></h3>
<p>One of Microsoft&#8217;s best practices is to ensure to add Tags (which are <em>key:value</em> pairs) to resources for accurate ownership tracking and cost management. Whether you apply tags to management groups, subscriptions, resource groups or resources, this ensures you can easily create reports based on these tags.</p>
<p><!-- /wp:paragraph --><!-- wp:paragraph --></p>
<p>However, the accuracy of these reports is tied to the quality of the tag key and value names. Most organization, that do not use Azure Policies to help enforce the correct tagging strategy, have big difference in these key/value pairs.</p>
<p><!-- /wp:paragraph --><!-- wp:paragraph --></p>
<p>To help get an overview of the missing tags on Azure resources I&#8217;ve created a PowerShell script that creates a CSV with tag key names as column name and the values below:</p>
<p><!-- /wp:paragraph --><!-- wp:image {"id":447,"sizeSlug":"large","linkDestination":"none"} --></p>
<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="1024" height="332" class="wp-image-447" src="https://www.armandit.com/wp-content/uploads/2025/03/2025-03-21-21_47_21-Map1-Excel-1024x332.png" alt="" srcset="https://www.armandit.com/wp-content/uploads/2025/03/2025-03-21-21_47_21-Map1-Excel-1024x332.png 1024w, https://www.armandit.com/wp-content/uploads/2025/03/2025-03-21-21_47_21-Map1-Excel-300x97.png 300w, https://www.armandit.com/wp-content/uploads/2025/03/2025-03-21-21_47_21-Map1-Excel-768x249.png 768w, https://www.armandit.com/wp-content/uploads/2025/03/2025-03-21-21_47_21-Map1-Excel.png 1070w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>
<p><!-- /wp:image --><!-- wp:paragraph --></p>
<p> </p>
<p><!-- /wp:paragraph --><!-- wp:heading --><!-- /wp:heading --><!-- wp:code --><!-- /wp:code --></p>								</div>
				</div>
				<div class="elementor-element elementor-element-f9fdfd1 elementor-widget elementor-widget-text-editor" data-id="f9fdfd1" data-element_type="widget" data-e-type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
									<p><strong>Script Usage</strong><br />The script takes the resource type name as input and you can easily pipe all of the applicable resource types using a <em>foreach</em> statement. If you have no idea which resource types you have in Azure, you can also use the <em>-allResourceTypes</em> switch to let the script traverse all registered resource providers in your Azure tenant (but be aware that the script can take a long time to finish, since by default over 2000 resource providers are registered).</p>
<p>The script is able to export tags from:</p>
<ul>
<li>All Resources &#8211; All Resource Types using the <em>-allResourceTypes </em>switch</li>
<li>All Resources &#8211; Single Resource Types using input parameter</li>
<li>1 Resource &#8211; Singel Resource Type using input parameters</li>
</ul>
<p> </p>								</div>
				</div>
				<div class="elementor-element elementor-element-f378fd9 elementor-alert-info elementor-widget elementor-widget-alert" data-id="f378fd9" data-element_type="widget" data-e-type="widget" data-widget_type="alert.default">
				<div class="elementor-widget-container">
							<div class="elementor-alert" role="alert">

						<span class="elementor-alert-title">Azure Resouce Types</span>
			
						<span class="elementor-alert-description">Azure resource types are presented in the following format:
<br><b>
Microsoft.Compute/virtualMachines
<br>
Microsoft.Network/virtualNetworks</b>

</span>
			
			
		</div>
						</div>
				</div>
				<div class="elementor-element elementor-element-75e1776 elementor-widget elementor-widget-text-editor" data-id="75e1776" data-element_type="widget" data-e-type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
									<p>The script exports the results per resource type to a .csv, so you will have 1 csv file per resource type:</p>
<p><img decoding="async" class="alignnone wp-image-720 size-full" src="https://www.armandit.com/wp-content/uploads/2025/03/ExportResults.png" alt="" width="2944" height="768" srcset="https://www.armandit.com/wp-content/uploads/2025/03/ExportResults.png 2944w, https://www.armandit.com/wp-content/uploads/2025/03/ExportResults-300x78.png 300w, https://www.armandit.com/wp-content/uploads/2025/03/ExportResults-1024x267.png 1024w, https://www.armandit.com/wp-content/uploads/2025/03/ExportResults-768x200.png 768w, https://www.armandit.com/wp-content/uploads/2025/03/ExportResults-1536x401.png 1536w, https://www.armandit.com/wp-content/uploads/2025/03/ExportResults-2048x534.png 2048w" sizes="(max-width: 2944px) 100vw, 2944px" /></p>								</div>
				</div>
				<div class="elementor-element elementor-element-bfbdfe5 elementor-widget elementor-widget-text-editor" data-id="bfbdfe5" data-element_type="widget" data-e-type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
									<p><strong>All Resources</strong><br />If you want to export tags for all resources from all resource types, you can add the <em>-allResourceTypes</em> when executing the script:</p>								</div>
				</div>
				<div class="elementor-element elementor-element-9a24d78 elementor-widget elementor-widget-code-block-for-elementor" data-id="9a24d78" data-element_type="widget" data-e-type="widget" data-widget_type="code-block-for-elementor.default">
				<div class="elementor-widget-container">
					<pre class='line-numbers theme-okaidia' data-show-toolbar='yes'><code class='language-powershell'>.\Export-AzureTags.ps1 -allResourceTypes</code></pre>				</div>
				</div>
				<div class="elementor-element elementor-element-845a107 elementor-widget elementor-widget-image" data-id="845a107" data-element_type="widget" data-e-type="widget" data-widget_type="image.default">
				<div class="elementor-widget-container">
															<img decoding="async" width="1280" height="588" src="https://www.armandit.com/wp-content/uploads/2025/03/ExportAllAllTags.gif" class="attachment-full size-full wp-image-698" alt="" />															</div>
				</div>
				<div class="elementor-element elementor-element-d19ad06 elementor-widget elementor-widget-text-editor" data-id="d19ad06" data-element_type="widget" data-e-type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
									<p><strong>All Resources &#8211; Single Resource Type</strong><br />If you want to export tags for all resources of a single resource type, you can execute the script as following:</p>								</div>
				</div>
				<div class="elementor-element elementor-element-dee77af elementor-widget elementor-widget-code-block-for-elementor" data-id="dee77af" data-element_type="widget" data-e-type="widget" data-widget_type="code-block-for-elementor.default">
				<div class="elementor-widget-container">
					<pre class='line-numbers theme-okaidia' data-show-toolbar='yes'><code class='language-powershell'>.\Export-AzureTags.ps1 -resourceType Microsoft.Compute/virtualMachines</code></pre>				</div>
				</div>
				<div class="elementor-element elementor-element-05219db elementor-widget elementor-widget-image" data-id="05219db" data-element_type="widget" data-e-type="widget" data-widget_type="image.default">
				<div class="elementor-widget-container">
															<img loading="lazy" decoding="async" width="1280" height="588" src="https://www.armandit.com/wp-content/uploads/2025/03/ExportAll1ResTypeTags.gif" class="attachment-full size-full wp-image-703" alt="" />															</div>
				</div>
				<div class="elementor-element elementor-element-d127a6c elementor-widget elementor-widget-text-editor" data-id="d127a6c" data-element_type="widget" data-e-type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
									<p><strong>All Resources &#8211; Multiple Resource Type</strong><br />If you want to export tags for all resources of multiple resource types, you can pipe them using a <em>foreach</em> statement. If you create a .csv with the resource type names (a sample .csv is on my <a href="https://github.com/ahatting/Azure/tree/main/Tags" target="_blank" rel="noopener">GitHub account</a>) you can quickly export the resource types required:</p>
<p><img loading="lazy" decoding="async" class="alignnone wp-image-719 size-full" src="https://www.armandit.com/wp-content/uploads/2025/03/Export-Tags-ResourceTypes.csv-Excel.png" alt="" width="1155" height="451" srcset="https://www.armandit.com/wp-content/uploads/2025/03/Export-Tags-ResourceTypes.csv-Excel.png 1155w, https://www.armandit.com/wp-content/uploads/2025/03/Export-Tags-ResourceTypes.csv-Excel-300x117.png 300w, https://www.armandit.com/wp-content/uploads/2025/03/Export-Tags-ResourceTypes.csv-Excel-1024x400.png 1024w, https://www.armandit.com/wp-content/uploads/2025/03/Export-Tags-ResourceTypes.csv-Excel-768x300.png 768w" sizes="(max-width: 1155px) 100vw, 1155px" /></p>								</div>
				</div>
				<div class="elementor-element elementor-element-50eb30b elementor-widget elementor-widget-code-block-for-elementor" data-id="50eb30b" data-element_type="widget" data-e-type="widget" data-widget_type="code-block-for-elementor.default">
				<div class="elementor-widget-container">
					<pre class='line-numbers theme-okaidia' data-show-toolbar='yes'><code class='language-powershell'>$resourceTypes = Import-Csv -Path &lt;path to csv&gt;
ForEach($type in $resourceTypes){
    .\Export-AzureTags.ps1 -resourceType $type.resourceType
}</code></pre>				</div>
				</div>
				<div class="elementor-element elementor-element-7cbcaac elementor-widget elementor-widget-image" data-id="7cbcaac" data-element_type="widget" data-e-type="widget" data-widget_type="image.default">
				<div class="elementor-widget-container">
															<img loading="lazy" decoding="async" width="1280" height="588" src="https://www.armandit.com/wp-content/uploads/2025/03/Export1ResMultiResTypeTags.gif" class="attachment-full size-full wp-image-725" alt="" />															</div>
				</div>
				<div class="elementor-element elementor-element-b9a1b03 elementor-widget elementor-widget-text-editor" data-id="b9a1b03" data-element_type="widget" data-e-type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
									<p><strong>1 Resources &#8211; Single Resource Type</strong><br />If you want to export tags for just 1 resource of a single resource type, you will need to supply the following:</p>
<ul>
<li>Resource Name</li>
<li>Resource Type Name</li>
<li>Resource Group Name</li>
<li>Subscription Id</li>
</ul>								</div>
				</div>
				<div class="elementor-element elementor-element-0738a43 elementor-widget elementor-widget-code-block-for-elementor" data-id="0738a43" data-element_type="widget" data-e-type="widget" data-widget_type="code-block-for-elementor.default">
				<div class="elementor-widget-container">
					<pre class='line-numbers theme-okaidia' data-show-toolbar='yes'><code class='language-powershell'>.\Export-AzureTags.ps1 -resourceName vnet-con-prd-westeurope-001 -resourceType Microsoft.Network/virtualNetworks -resourceGroupName rg-network-con-prd-001 -subscriptionId c4fcac9a-ab6c-43e2-80b0-83fbe6f12345</code></pre>				</div>
				</div>
				<div class="elementor-element elementor-element-460eb37 elementor-widget elementor-widget-image" data-id="460eb37" data-element_type="widget" data-e-type="widget" data-widget_type="image.default">
				<div class="elementor-widget-container">
															<img loading="lazy" decoding="async" width="1280" height="588" src="https://www.armandit.com/wp-content/uploads/2025/03/Export1Res1ResTypeTags.gif" class="attachment-full size-full wp-image-714" alt="" />															</div>
				</div>
				<div class="elementor-element elementor-element-004f3cf elementor-widget elementor-widget-text-editor" data-id="004f3cf" data-element_type="widget" data-e-type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
									<p>The script can be used to sign-in to Azure interactively or non-interactively. You can download the script from my GitHub account <a href="https://github.com/ahatting/Azure/tree/main/Tags" target="_blank" rel="noopener">here</a>.</p>
<p>Happy exporting!</p>								</div>
				</div>
					</div>
				</div>
				</div>
		]]></content:encoded>
					
					<wfw:commentRss>https://www.armandit.com/2025/03/21/export-azure-resource-tags/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
