Azure - Concept

Azure Tags - What, Why and Best Practices?

Vipin Vij

Vipin

Introduction:

Imagine a vast library, filled with books of different genres, authors, and topics. To easily identify books and categorize them based on authors or genres you use sticky notes or post-it stickers. Take this analogy and let's jump on to Azure. Here, Azure is a vast library, filled with many different resources such as books of different genres, authors, and topics. You have resources such as virtual machines, databases, storage accounts, or even containers.

Azure tags are like the labels you attach to the books in the library to help you find and manage them more easily.

Me and my analogies πŸ˜€, I know but I hope it will help you easily visualize Cloud Computing.


With an ocean of services and resources in Azure, although all of them are amazing, however, managing these resources effectively can be a daunting task, especially when your cloud environment grows or maybe you are an Azure admin of a big company. This is where Azure tags rescue, simplifying resource organization, cost management, and more. In this blog post, we'll explore the world of Azure tags, understanding what they are, why they are used, their benefits, how to use them, best practices, and their limitations, with the help of examples and analogies.

So, Cloud technologies refer to a collection of computing resources, services, and infrastructure that are delivered over the internet ("the cloud") by cloud service providers. Instead of relying solely on on-premise data centers, organizations can leverage the power and flexibility of the cloud to meet their computing needs.

Resources don't inherit the tags you apply to a resource group or a subscription.

How to assign Tags?

Ok, let's an example. We would need an Azure resource. So, let's create a Storage account and assign TAGS to it. (Refer the images below)



what-is-the-cloud

  • Step 1: Create an Azure Resource: We create a storage account. This can be any Azure resource of your choice. A Virtual Machine, Web App, Azure Function, literally any resource, with few exceptions, that you can read here.


  • Step 2: Go to "Tags" Tab: So, while in the process of creating the Storage Account (or whatever resource you are creating), Reach till the "TAGS" tab while creating the Azure resource.


  • Step 3: Assign Tags: Assign the tag of your choice and business need. Here I assign two tags.

  • The first TAGEnv=Prod, this help to identify that this storage account is used in the Production Environment.

    The second TAG Dept=Fin, this tag helps us to categorize that this storage account is consumed by the Finance department in my company. Based on this I can send the bill of this storage account to the Finance department.



    what-is-the-cloud

  • Step 4: Check and validate Tags: Once the resource is created. You can check and validate the Azure tags that you assigned in previous steps.


  • Step 5: Utilize Tags:: Once tags are assigned, you can filter, sort, and organize resources based on these tags. For example, you can filter resources to view all the Storage Account or Virtual Machines belonging to the Finance department.

Why Are Azure Tags Used?

  • Resource Categorization:
  • Azure tags allow you to classify resources based on any criteria you choose. For instance, you can tag resources by department, project, environment (e.g., production or development), or cost center.

  • Cost Management:
  • By assigning tags to resources, you can track and allocate costs more accurately. This helps you understand where your cloud spending is going and make informed decisions about resource optimization.

  • Resource Organization:
  • Tags enable you to group related resources together. This simplifies resource management and streamlines tasks like monitoring, access control, and backup policies.

  • Governance and Compliance:
  • Azure tags can be used to enforce governance policies and ensure compliance by identifying resources that require specific security measures or regulations.

  • Resource Tracking:
  • Tags help you monitor and analyze resource usage, performance, and other key metrics. They are particularly valuable for troubleshooting and auditing.

Benefits of Azure Tags

  • Improved Visibility:
  • Azure tags provide a clear view of your resources and their attributes, allowing you to identify, manage, and monitor them efficiently.

  • Cost Control:
  • Tagging resources lets you allocate costs accurately, optimize spending, and reduce wastage, which is essential for budget-conscious organizations.

  • Enhanced Organization:
  • Tags enable resource grouping and simplify the application of policies, making your cloud environment more manageable.

  • Policy Enforcement:
  • You can enforce governance and compliance policies by tagging resources and using Azure Policy to govern their use.

  • Smarter Budgeting:
  • By digging into historical spending patterns using tags, you can make more accurate predictions about your future costs. This helps you anticipate your upcoming resource requirements and tweak your budgets accordingly, making sure you're always financially prepared.

  • Efficient Resource Management:
  • Tags act as your cost-saving detectives, pointing out underused or overly expensive resources. By identifying the tags that are racking up the biggest bills, you can pinpoint areas where efficiency gains and optimization are needed. This might involve resizing virtual machines, powering down unused resources, or switching to more cost-effective service tiers.

  • Transparent Cost Sharing:
  • Tags empower you to lay bare your cost data to different teams or departments. This transparency can be a game-changer for demonstrating the value of Azure services to stakeholders or for internal cost allocation processes, where each department or team pays for its usage.

  • Tailored Insights:
  • Azure's cost management tools let you craft custom reports and dashboards based on tags, putting you in the driver's seat. This flexibility means you can shape your cost analysis to fit your organization's unique requirements and reporting standards.

  • Smooth Sailing in Shared Spaces:
  • In multi-tenant or shared environments where various teams or customers share the same Azure subscription, tags play a vital role in ensuring precise billing and cost allocation for each entity. It's like the tags are the traffic controllers, making sure each user knows exactly what they owe.

Policies for Tags

    1. Azure Policy is a service in Azure that you use to create, assign and, manage policies.

    2. You use Azure Policy to enforce tagging rules and conventions. By creating a policy, you avoid the scenario of resources being deployed to your subscription that don't have the expected tags for your organization. Microsoft documentation.

Best Practices | Ideas for tagging.

The environment type is defined in the environment classification below.
Example Values: Prod, Dev, Test, QA, Production
Name or email address of person who manage the resource.
Example Values: youradmin@yourcompanymail.com
This is your internal billing code
Example Values: 012347
Which department owns/uses the resource>br> Example Values: Fin, IT, HR etc.
Full Name of the User or User Email who created a Resource in Azure
Example Values: employee1@yourcompanymail.com

Limitations

    1. Not all resource types support tags. Check out Microsoft documentation.


    2. You can only apply tags to resources that support Resource Manager operations


    3. All ARM resources support tagging.


    4. There is a maximum of 15 tags that can be associated with a resource (VM, Network, etc.) or resource group.


    5. Only alphanumeric characters can be used for tags.


    6. Tag names can't contain these characters: <,>, %, &, \, ?, /


    7. The maximum number of characters for a tag name is 512. For storage accounts, this is limited to 128 characters. Not case-sensitive.


    8. The maximum number of characters for a tag value is 256. Case-sensitive.


    9. Tags are free-form text so consistent correct spelling is very important.


    10. There is no inheritance hierarchy for tags meaning that tags applied at the resource group level are not inherited by their members.


    11. Each resource, resource group, and subscription can have a maximum of 50 tag name-value pairs. If you need to apply more tags than the maximum allowed number, use a JSON string for the tag value. The JSON string can contain many of the values that you apply to a single tag name. A resource group or subscription can contain many resources that each have 50 tag name-value pairs.


    12. Classic resources such as Cloud Services don't support tags.


Watch latest updates

Related blogs

Virtual Machine

A computer system created using software on one physical computer in order to emulate the functionality of another separate physical computer.

Data Center

A large group of networked computer servers typically used by organizations for the remote storage, processing, or distribution of large amounts of data.

Virtualisation

Virtualization is a process that allows for more efficient utilization of physical computer hardware and is the foundation of cloud computing.

Explore more

What is Cloud?

Understand the What and Why behind cloud technologies.

Hypervisor

Critical concept that made virtual machines possible.

Cloud deployment models

Public Cloud vs Private Cloud vs Hybrid Cloud

Serverless

Understand this often misleading term.