SpyglassMTG Blog

  • Blog
  • Azure Tip of the Day:  Hidden tags give more meaning to your Azure resources

Azure Tip of the Day:  Hidden tags give more meaning to your Azure resources

Azure Tip of the Day:  Hidden tags give more meaning to your Azure resources

As an infrastructure code developer, you strive to make your code more streamlined and reusable. A common challenge when creating resources in an Azure environment is deploying resources that have meaningful yet globally unique names.

Naming standards within an organization can help here, but even that can cause naming conflicts. To address this, you can leverage string functions like concatenate, pad, substring, and some language specific ones like uniqueString and guid.  While these will get you the uniqueness you require (and remain idempotent), they leave you with resources with less than meaningful names.

You ask the question, how important are the names to how the resources operate? In most cases there isn’t any importance. The idempotent nature is important for maintaining the lifecycle of the resources, but the name itself is mostly for humans.  The folks at Azure have a clever way of helping with this, and that is using hidden tags, and more specifically, the hidden title tag. When using the hidden “title-tag,” you can show a more meaningful name or description in the Azure portal through assigning this special tag a value.

Examine the two storage accounts below: The storage account name is based on some naming pattern, but the resulting name is somewhat cryptic at first glance. However, the second account, storbas873453eupr1, has the hidden-title tag applied and as you can see has a description in () after its name.

josh1

If we examine the resource json, we can see the hidden-title tag and its value:

josh2

While viewing the tags in the Azure portal, it will only show the non-hidden tags:

josh3

You can apply hidden tags the same way you do with other tags, e.g.: Azure PowerShell, Azure CLI, Azure Portal, and through infrastructure deployments with ARM, Bicep, and Terraform. For the Azure Portal, it’s easy to add or update the hidden tags by setting a new value. To remove them, though, it’s best to use one of the programmatic methods.

josh4

For more information on hidden tags, review the official documentation at:

If you need more help with your Azure infrastructure or Microsoft 365 environments, reach out to us and our experienced team of architects and engineers at Spyglass MTG can assist you.

Related Posts
Azure Bicep Tip of the Day:  Optional parameters become conditional property assignments