You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

部署ARM模板创建EventGrid数据连接时遇EventHubValidationErrorFound错误

部署Kusto EventGrid数据连接时出现"mapping does not exist"错误

错误信息

代码:EventHubValidationErrorFound
消息:[BadRequest] 发现验证错误:mapping does not exist

需求

通过ARM模板在指定Kusto集群上创建EventGrid类型的数据连接。

使用的ARM模板

{
  "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "kustoclusterName": {
      "type": "string"
    },
    "kustoDbName": {
      "type": "string"
    },
    "dataFormatType": {
      "type": "string",
      "defaultValue": "json"
    },
    "kustoDataConnectionsName": {
      "type": "string"
    },
    "subscriptionId": {
      "type": "string",
      "defaultValue": "[subscription().subscriptionId]"
    },
    "resourceGroup": {
      "type": "string",
      "defaultValue": "[resourceGroup().name]"
    },
    "location": {
      "type": "string",
      "defaultValue": "[resourceGroup().location]"
    },
    "dpuMI": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "allowedValues": [
        "EventHub",
        "EventGrid"
      ]
    },
    "eventHubNamespace": {
      "type": "string"
    },
    "eventHub": {
      "type": "string"
    },
    "eventHubSubscriptionId": {
      "type": "string",
      "defaultValue": "[subscription().subscriptionId]"
    },
    "eventHubResourceGroupName": {
      "type": "string",
      "defaultValue": "[resourceGroup().name]"
    },
    "consumergroup": {
      "type": "string",
      "defaultValue": "$Default"
    },
    "storageAccountName": {
      "type": "string"
    },
    "mappingRuleName": {
      "type": "string"
    },
    "tableName": {
      "type": "string"
    },
    "dataFormat": {
      "type": "string",
      "allowedValues": [
        "JSON",
        "MULTIJSON",
        "CSV",
        "PARQUET"
      ]
    },
    "description": {
      "type": "string",
      "defaultValue": ""
    }
  },
  "variables": {},
  "resources": [
    {
      "condition": "[equals(parameters('kind'), 'EventHub')]",
      "type": "Microsoft.Kusto/clusters/databases/dataConnections",
      "apiVersion": "2021-08-27",
      "name": "[concat(parameters('kustoclusterName'), '/', parameters('kustoDbName'), '/', parameters('kustoDataConnectionsName'))]",
      "location": "[parameters('location')]",
      "kind": "[parameters('kind')]",
      "properties": {
        "managedIdentityResourceId": "[parameters('dpuMI')]",
        "eventHubResourceId": "[resourceId(parameters('eventHubSubscriptionId'), parameters('eventHubResourceGroupName'), 'Microsoft.EventHub/namespaces/eventhubs', parameters('eventHubNamespace'), parameters('eventHub'))]",
        "consumerGroup": "[parameters('consumergroup')]"
      },
      "tags": {
        "Version": "0.0.0.0",
        "Description": "[parameters('description')]"
      }
    },
    {
      "condition": "[equals(parameters('kind'), 'EventGrid')]",
      "type": "Microsoft.Kusto/clusters/databases/dataConnections",
      "apiVersion": "2021-08-27",
      "name": "[concat(parameters('kustoclusterName'), '/', parameters('kustoDbName'), '/eg', parameters('kustoDataConnectionsName'))]",
      "location": "[parameters('location')]",
      "kind": "[parameters('kind')]",
      "properties": {
        "ignoreFirstRecord": "[equals(parameters('dataFormat'), 'CSV')]",
        "storageAccountResourceId": "[resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName'))]",
        "managedIdentityResourceId": "[parameters('dpuMI')]",
        "eventHubResourceId": "[resourceId(parameters('subscriptionId'), parameters('resourceGroup'), 'Microsoft.EventHub/namespaces/eventhubs', parameters('eventHubNamespace'), parameters('eventHub'))]",
        "consumerGroup": "[parameters('consumergroup')]",
        "tableName": "[parameters('tableName')]",
        "dataFormat": "[parameters('dataFormat')]",
        "blobStorageEventType": "Microsoft.Storage.BlobCreated",
        "mappingRuleName": "[parameters('mappingRuleName')]"
      },
      "tags": {
        "Version": "0.0.0.0",
        "Description": "[parameters('description')]"
      }
    }
  ]
}

使用的参数文件

{
  "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
  "contentVersion": "0.0.0.0",
  "parameters": {
    "eventHubNamespace": {
      "value": "cpcnx-ehns-adlsv2tokusto-test01"
    },
    "eventHub": {
      "value": "cpcnx-eh-cds-storeingest-adxingest-dbingest-test01"
    },
    "consumergroup": {
      "value": "dpucg"
    },
    "kustoclusterName": {
      "value": "cpcnx-adx-test01"
    },
    "kustoDbName": {
      "value": "ingest"
    },
    "kustoDataConnectionsName": {
      "value": "cdsstoreingestadxingestdbingest"
    },
    "eventHubSubscriptionId": {
      "value": "{subId}"
    },
    "eventHubResourceGroupName": {
      "value": "cpcnx-test-test01"
    },
    "dpuMI": {
      "value": "/subscriptions/{subId}/resourceGroups/{regGroup}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/cpcnx-pipmi-test01"
    },
    "kind": {
      "value": "EventGrid"
    },
    "storageAccountName": {
      "value": "cpcnxsaingesttest01"
    },
    "mappingRuleName": {
      "value": "EHCPCDevices_FastStream_Mapping"
    },
    "tableName": {
      "value": "EHCPCDevices_FastStream"
    },
    "dataFormat": {
      "value": "PARQUET"
    }
  }
}

内容的提问来源于stack exchange,提问作者Guilherme Matheus

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.15 17:04:56