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

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

每次我尝试使用

创建 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上创建资源,当您点击自动化选项时,您将获得模板。

enter image description here

关于用于创建类型为 : General 的 Application Insights 资源的 PowerShell 脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47057492/

相关文章:

sql-server - Powershell将对象插入SQL Server数据库更优雅的解决方案

c# - 如何在 Windows 窗体应用程序中运行 PowerShell 命令?

powershell - 无法在 Windows 10 中加载 dll 程序集(来自 HRESULT : 0x80131515) 的异常

azure - Azure SQL DW 超大规模和 Azure Synapse 路线图

Azure Log4Net Appender 避免为每个条目创建 xml 文件

azure - 无法从应用程序见解导出完整日志信息

azure - 应用程序洞察 TraceListener : Setting Severity level

Azure 应用服务 - 实例与计划的 CPU 百分比

azure - 如何从连接字符串确定 Application Insights 实例?

Powershell 检查本地管理员凭据