Using Azure Resource Tagging

Tagging is a concept that you already use in many ways. For an example, you add tags on blog posts or you add tags when you upload a YouTube video. Tags can be used to identify the categories that something belongs to.

Resource tagging is a useful feature when you are dealing with large number of resources in your Azure subscription.

Like resource groups, tags can be also used to logically organize your resources.

Tags are basically key-value pairs you can add for resources. Not all the resources support tags. You can refer this article to understand tagging supported and unsupported resource.

I will give you a small example to further understand tagging.

You can add tags to your resources to indicate your environment. Like,

Environment : Development
Environment : QA
Environment : Production

Your team can decide a tagging practice that everyone can follow. It would be easy for everyone in your team to understand the tag naming convention.

Some advantages of Tagging
  • Organize resources
  • Retrieve resources by tags
  • Organize resources for billing
  • Apply bulk actions based on tags (Automation)
  • Access control and compliance
 Demo : Let’s add tags to your resources

You can add tags to your resources by below methods
  • Using the portal
  • Using the PowerShell commands
  • Using CLI
Let’s see how to add tags using the Portal. In this example I will add tags to a VM.

Login to your Azure account and go to the resource that you want to add tags. In my case its this VM.


Go to Tags, Add the required tags one by one as key and the value


That's it.

Please note that it is not necessary the resources with the same resource tag belongs to the same resource group.

Add tags to multiple resources

You can tag multiple resources at once. Go to your resource group and select multiple resources and add tags as required.



Also you can go to your subscription and add multiple tags.

If you add the same key for a resource again, it will replace the previous one.

View Resources by Tags

You can filter resources by tag names. In the portal search for Tags. 



Select for specific tag and you can see the resources under the Tag you selected.


Tags for Cost Analysis

In the Azure cost analysis, we can use the tags to easily filter the cost by tags.

Go to your subscription and then Cost analysis



Select tags from the filter items.

Select the tag you want and click on the small green button.



The cost information will be filtered out based on the selected tags.

Conclusion

I hope you learned something useful from my blog post.

To learn more about resource tags (Adding tags using PowerShell and CLI Commands), refer the below links




Comments

Popular Posts