cpo*_*ign 5 azure azure-application-insights azure-rm-template
我有一个将 Application Insights 部署到 Azure 的 ARM 模板。
从那里我需要获取“应用程序 ID”
“正在监视您在发布流中部署的服务的 Application Insights 资源的应用程序 ID。在 API 访问边栏选项卡中找到它”
将如下输出添加到您的模板中:
"outputs": {
"AppInsightAppId": {
"type": "String",
"value": "[reference(resourceId('Microsoft.Insights/components', variables('appInsightsName')), '2014-04-01').AppId]"
}
}
Run Code Online (Sandbox Code Playgroud)
例如:
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"appInsightsNamePrefix": {
"defaultValue": "",
"type": "String"
}
},
"variables": {
"appInsightsName": "[concat(parameters('appInsightsNamePrefix'), uniqueString(resourceGroup().id))]"
},
"resources": [
{
"type": "Microsoft.Insights/components",
"apiVersion": "2014-04-01",
"name": "[variables('appInsightsName')]",
"location": "[resourceGroup().location]",
"kind": "web",
"properties": {
"ApplicationId": "[variables('appInsightsName')]"
}
}
],
"outputs": {
"AppInsightAppId": {
"type": "String",
"value": "[reference(resourceId('Microsoft.Insights/components', variables('appInsightsName')), '2014-04-01').AppId]"
}
}
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
2895 次 |
最近记录: |