小编Pri*_*ngh的帖子

我们能否在 Azure 资源组模板中获取 Application Insights 的连接字符串?

我们可以在 Azure 资源组模板中检索 Application Insights 实例的连接字符串吗?

我可以通过下面的代码检索仪器密钥,但是当我尝试使用相同的或 Listkey 获取连接字符串时,它会给出错误。

"outputs": {
    "MyAppInsightsInstrumentationKey": {
        "value": "[reference(resourceId('Microsoft.Insights/components', variables('myAppInsightsInstanceName')), '2014-04-01').connectionString]",
        "type": "string"
    }
}
Run Code Online (Sandbox Code Playgroud)

错误:{“error”:{“code”:“InvalidTemplate”,“message”:“部署模板验证失败:'找不到模板变量'myAppInsightsInstanceName'。请参阅https://aka.ms/arm-template /#变量用于使用详细信息。'.","additionalInfo":[{"type":"TemplateViolation","info":{"lineNumber":95,"linePosition":40,"path":"properties.template .outputs.MyAppInsightsInstrumentationKey"}}]}}

instrumentation azure azure-resource-manager azure-application-insights

3
推荐指数
1
解决办法
3402
查看次数