PowerShell脚本,用于创建类型为:General的Application Insights资源

时间:2017-11-01 14:45:09

标签: powershell azure azure-application-insights azure-resource-manager

每次尝试使用

创建Application Insights资源时
  

“Application_Type”=“一般”

  

“Application_Type”=“其他”

使用Azure Template,它创建为"ASP.NET"类型。似乎"Application_Type"字段的默认值为"ASP.NET""Web"

如何使用ARM模板使用"Application_Type" = "General"创建Application Insights资源?我特别需要一个General类型的Application Insight实例到collect logs from Azure AD B2C so that we can diagnose problems with our custom policies

1 个答案:

答案 0 :(得分:2)

以下模板适合您。

{
    "$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门户上创建资源,当您单击Automation options时,您将获得模板。

enter image description here