每次我尝试使用
创建 Application Insights 资源时"Application_Type" = "General"
或
"Application_Type" = "Other"
使用 Azure Template ,它正在创建为 "ASP.NET"
类型。 "Application_Type"
字段的默认值似乎是 "ASP.NET"
或 "Web"
。
如何使用 ARM 模板创建 "Application_Type"= "General"
的 Application Insights 资源?我特别需要一个通用类型的 Application Insight 实例 collect logs from Azure AD B2C so that we can diagnose problems with our custom policies .
最佳答案
以下模板适合您。
{
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"name": {
"type": "string",
"defaultValue": "shuitest4"
},
"type": {
"type": "string",
"defaultValue": "other"
},
"hockeyAppToken": {
"type": "string",
"defaultValue": ""
},
"hockeyAppId": {
"type": "string",
"defaultValue": ""
},
"regionId": {
"type": "string",
"defaultValue": "southcentralus"
},
"requestSource": {
"type": "string",
"defaultValue": "IbizaAIExtension"
}
},
"resources": [
{
"name": "[parameters('name')]",
"type": "microsoft.insights/components",
"location": "[parameters('regionId')]",
"apiVersion": "2014-08-01",
"properties": {
"ApplicationId": "[parameters('name')]",
"Application_Type": "[parameters('type')]",
"HockeyAppToken": "[parameters('hockeyAppToken')]",
"HockeyAppId": "[parameters('hockeyAppId')]",
"Flow_Type": "Redfield",
"Request_Source": "[parameters('requestSource')]"
}
}
]
}
您可以通过一种简单的方法获取模板。您可以在Azure Portal上创建资源,当您点击自动化选项
时,您将获得模板。
关于用于创建类型为 : General 的 Application Insights 资源的 PowerShell 脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47057492/