Ale*_*all 19 azure azure-resource-manager azure-application-insights
有没有办法在Azure资源组模板中检索Application Insights实例的Instrumentation Key?
我已经尝试过这里的说明来检索Azure资源上可用的列表*操作列表,但Microsoft.Insights/components
不会在任何地方出现在列表中.这让我觉得目前无法在模板中检索Instrumentation Key
Ale*_*all 45
经过一些挖掘和实验,这就是我发现的作品:
"outputs": {
"MyAppInsightsInstrumentationKey": {
"value": "[reference(resourceId('Microsoft.Insights/components', variables('myAppInsightsInstanceName')), '2014-04-01').InstrumentationKey]",
"type": "string"
}
}
Run Code Online (Sandbox Code Playgroud)
尝试一下(使用 azure cli)
az resource show -g $RESOURCE_GROUP -n $APP_INSIGHTS --resource-type "microsoft.insights/components" --query properties.InstrumentationKey
Run Code Online (Sandbox Code Playgroud)
Instrumentation Key 属于资源,可以在 Azure 资源管理器模板中找到。如果要查找 Instrumentation Key,则需要将 ResourceType 定义为 Microsoft.Insights/components。试试下面的代码:
$resourcevalue=Get-AzureRmResource -ResourceGroupName Default-ApplicationInsights-*** -ResourceType Microsoft.Insights/components -ResourceName **hdinsights -ApiVersion 2015-05-01
$resourcevalue.Properties.InstrumentationKey
归档时间: |
|
查看次数: |
8281 次 |
最近记录: |