azureazure-application-insightsazure-cliavailability

Azure Availability test - A single 'hidden-link' tag pointing to an existing AI component is required. Found none


I am trying to create a url ping test for an app service hosted in azure through azure cli

az monitor app-insights web-test create 
--location "Australia East" 
--tags 'hidden-link:/subscriptions/{subid}/resourceGroups/{rg}/providers/microsoft.insights/components/{appinsightname}'
--description "Ping web test alert for mytestwebapp" 
--enabled true --frequency 900 
--web-test-kind "standard" 
--locations Id="emea-au-syd-edge" 
--defined-web-test-name "my-webtest-my-component" 
--http-verb "GET"  
--request-url "https://myurl.net/" 
--retry-enabled true 
--synthetic-monitor-id "my-webtest-my-component" 
--timeout 120 
--ssl-lifetime-check 100 
--ssl-check true 
--resource-group "{rgname}" 
--name "my-webtest-my-component" 

I am getting "(BadRequest) A single 'hidden-link' tag pointing to an existing AI component is required. Found none." I am not sure about how to format the hidden-link with resource id of app insight. not much documentations are found regarding this, any help would be appreciated


Solution

  • Found the hidden-link property's format later, It should come under tags

    --tags hidden-link:/subscriptions/{subscriptionId}/resourceGroups/{ResourceGroupName}/providers/microsoft.insights/components/{appInsightName}=Resource