What does "hidden-link:" mean in Azure Resource Manager Tags
Asked Answered
M

3

24

I exported an Azure Resource Manager JSON template from my resource group on Azure. I see a bunch of tags in the generated file like:

"tags": {
    "hidden-link:/subscriptions/[my-subscription-id-here]/resourceGroups/[my-resource-group]/providers/Microsoft.Sql/servers/[my-database-server-name]/databases/[my-database-name]": "Resource"
},

The only documentation I can find on it is from Using tags to organize your Azure resources, which says:

You may see tags that start with "hidden-" and "link:". These are internal tags, which you should ignore and avoid changing.

The problem is that I'm going to be deploying this resource template to a completely different subscription than the one whose ID is hard-coded into the tag. Any meaning that the hard-coded subscription id has in this tag will be lost. Can I safely remove this tag? What does it mean, and how is it used once deployed?

Mouseear answered 25/7, 2016 at 22:3 Comment(0)
H
12

These tags are used to associate related resources. They are used to populate the Linked Resources section. Removing the tags will prevent resources from displaying as Linked Resources but will not impact any functionality.

enter image description here

Hellenic answered 26/7, 2016 at 14:41 Comment(2)
Where is the "Linked Resources section" in the Azure Portal?Carious
@MaximeGélinas I don't know that it exists any more.Hellenic
K
25

Just to help stop anyone else from wasting a couple of hours in frustration:

Don't remove these tags from your generated ARM template for web tests in Application Insights.

I was wondering if I really needed these tags since they were very specific to the resource that I used to create the template from. Reading this answer I figured that it wasn't necessary so I removed them and promptly forgot about removing them.

The deployment then started failing with the very descriptive error:

{
 "code": "BadRequest",
 "message": "{
   "code": "BadRequest",
   "message": "Bad Request\",
   "innererror": 
    {
       "diagnosticcontext": "d657bd3b-6b5f-4b24-8963-c2e9ac76a65b\",
       "time": "2019-02-05T13:37:23.6473698Z"
    }
}

Putting the "hidden-links" back in seems to fix the issue.

An alternative that makes the script a bit more reusable is specifying the "hidden-link" as follows:

"tags": { "[concat('hidden-link:', resourceId('Microsoft.Insights/components', parameters('appInsightsName')))]": "Resource" }

Where applicationInsightName is a variable containing the name of the ApplicationInsight instance

Kondon answered 11/2, 2019 at 13:55 Comment(2)
See also azure.microsoft.com/en-au/blog/…Schutzstaffel
This answer describes behavior related to hidden links, but it doesn't actually answer the question, "What does "hidden-link:" mean?"Concupiscence
H
12

These tags are used to associate related resources. They are used to populate the Linked Resources section. Removing the tags will prevent resources from displaying as Linked Resources but will not impact any functionality.

enter image description here

Hellenic answered 26/7, 2016 at 14:41 Comment(2)
Where is the "Linked Resources section" in the Azure Portal?Carious
@MaximeGélinas I don't know that it exists any more.Hellenic
S
-3

Azure Resource Manager (ARM) tag is optional to an Azure Resource or an Azure Resource Group.

You can safely remove any tag without affecting your ARM deployment.

Sextant answered 26/7, 2016 at 13:40 Comment(5)
Thanks. Any insight into what the "hidden-link" means?Mouseear
It's just as you've found out on Microsoft's documentation article. They are their internal tags which do not have any meaning to the general public.Sextant
If this answer is able to answer your question or solve your issue, please kindly marked it as answer so it helps others as wellSextant
The reason to add this tag, is that this creates the link between the WebApp and Application Insights resources. This allows the portal experience to work so that when you navigate to the Application Insights option in the WebApp left-side menu, it shows you the data from the right AppInsights resource. Ref: winterdom.com/2017/08/01/aiarmUnrelenting
Omitting tags or declaring an empty tag property in an ARM template will remove them from the resource.Proclaim

© 2022 - 2024 — McMap. All rights reserved.