Skip to content

Commit e07cf91

Browse files
committed
add comments
1 parent 1406e57 commit e07cf91

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

internal/services/applicationinsights/application_insights_web_test_resource.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,11 @@ func resourceApplicationInsightsWebTestsCreate(d *pluginsdk.ResourceData, meta i
166166
return tf.ImportAsExistsError("azurerm_application_insights_web_test", id.ID())
167167
}
168168

169+
// Azure uses a special "hidden-link" tag to associate a web test with its parent Application Insights
170+
// component. The tag key is "hidden-link:<resource_id>" where <resource_id> is the full ARM resource ID
171+
// of the Application Insights component, and the value is "Resource". This tag is injected into the
172+
// user-supplied tags map before sending the request. It is genreally undocumented but can be seen in
173+
// https://learn.microsoft.com/en-us/azure/azure-monitor/app/availability?tabs=standard
169174
t := d.Get("tags").(map[string]interface{})
170175
tagKey := fmt.Sprintf("hidden-link:%s", appInsightsId.ID())
171176
t[tagKey] = "Resource"
@@ -259,6 +264,11 @@ func resourceApplicationInsightsWebTestsUpdate(d *pluginsdk.ResourceData, meta i
259264
}
260265
}
261266

267+
// Azure uses a special "hidden-link" tag to associate a web test with its parent Application Insights
268+
// component. The tag key is "hidden-link:<resource_id>" where <resource_id> is the full ARM resource ID
269+
// of the Application Insights component, and the value is "Resource". This tag is injected into the
270+
// user-supplied tags map before sending the request. It is genreally undocumented but can be seen in
271+
// https://learn.microsoft.com/en-us/azure/azure-monitor/app/availability?tabs=standard
262272
if d.HasChange("tags") {
263273
appInsightsId, err := components.ParseComponentID(d.Get("application_insights_id").(string))
264274
if err != nil {

0 commit comments

Comments
 (0)