|
| 1 | +--- |
| 2 | +title: 'Create an Event Grid data connection for Azure Data Explorer by using Azure Resource Manager template' |
| 3 | +description: In this article, you learn how to create an Event Grid data connection for Azure Data Explorer by using Azure Resource Manager template. |
| 4 | +author: lucygoldbergmicrosoft |
| 5 | +ms.author: lugoldbe |
| 6 | +ms.reviewer: orspodek |
| 7 | +ms.service: data-explorer |
| 8 | +ms.topic: conceptual |
| 9 | +ms.date: 11/28/2019 |
| 10 | +--- |
| 11 | + |
| 12 | +# Create an Event Grid data connection for Azure Data Explorer by using Azure Resource Manager template |
| 13 | + |
| 14 | +> [!div class="op_single_selector"] |
| 15 | +> * [Portal](ingest-data-event-grid.md) |
| 16 | +> * [C#](data-connection-event-grid-csharp.md) |
| 17 | +> * [Python](data-connection-event-grid-python.md) |
| 18 | +> * [Azure Resource Manager template](data-connection-event-grid-resource-manager.md) |
| 19 | +
|
| 20 | + |
| 21 | +Azure Data Explorer is a fast and highly scalable data exploration service for log and telemetry data. Azure Data Explorer offers ingestion (data loading) from Event Hubs, IoT Hubs, and blobs written to blob containers. In this article, you create an Event Grid data connection for Azure Data Explorer by using Azure Resource Manager template. |
| 22 | + |
| 23 | +## Prerequisites |
| 24 | + |
| 25 | +* If you don't have an Azure subscription, create a [free Azure account](https://azure.microsoft.com/free/) before you begin. |
| 26 | +* Create [a cluster and database](create-cluster-database-portal.md) |
| 27 | +* Create [a table and column mapping](ingest-data-event-grid.md#create-a-target-table-in-azure-data-explorer) |
| 28 | +* Create [an event hub](https://docs.microsoft.com/azure/event-hubs/event-hubs-create) |
| 29 | +* Create [a storage account with an Event Grid subscription](ingest-data-event-grid.md#create-an-event-grid-subscription-in-your-storage-account). |
| 30 | + |
| 31 | +## Azure Resource Manager template for adding an Event Grid data connection |
| 32 | + |
| 33 | +The following example shows an Azure Resource Manager template for adding an Event Grid data connection. You can [edit and deploy the template in the Azure portal](/azure/azure-resource-manager/resource-manager-quickstart-create-templates-use-the-portal#edit-and-deploy-the-template) by using the form. |
| 34 | + |
| 35 | +```json |
| 36 | +{ |
| 37 | + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", |
| 38 | + "contentVersion": "1.0.0.0", |
| 39 | + "parameters": { |
| 40 | + "namespaces_eventhubns_name": { |
| 41 | + "type": "string", |
| 42 | + "defaultValue": "eventhubns", |
| 43 | + "metadata": { |
| 44 | + "description": "Specifies the Event Hub Namespace name." |
| 45 | + } |
| 46 | + }, |
| 47 | + "EventHubs_eventhubdemo_name": { |
| 48 | + "type": "string", |
| 49 | + "defaultValue": "eventhubdemo", |
| 50 | + "metadata": { |
| 51 | + "description": "Specifies the Event Hub name." |
| 52 | + } |
| 53 | + }, |
| 54 | + "consumergroup_default_name": { |
| 55 | + "type": "string", |
| 56 | + "defaultValue": "$Default", |
| 57 | + "metadata": { |
| 58 | + "description": "Specifies the consumer group of the Event Hub." |
| 59 | + } |
| 60 | + }, |
| 61 | + "StorageAccounts_storagedemo_name": { |
| 62 | + "type": "string", |
| 63 | + "defaultValue": "storagedemo", |
| 64 | + "metadata": { |
| 65 | + "description": "Specifies the storage account name" |
| 66 | + } |
| 67 | + }, |
| 68 | + "Clusters_kustocluster_name": { |
| 69 | + "type": "string", |
| 70 | + "defaultValue": "kustocluster", |
| 71 | + "metadata": { |
| 72 | + "description": "Specifies the name of the cluster" |
| 73 | + } |
| 74 | + }, |
| 75 | + "databases_kustodb_name": { |
| 76 | + "type": "string", |
| 77 | + "defaultValue": "kustodb", |
| 78 | + "metadata": { |
| 79 | + "description": "Specifies the name of the database" |
| 80 | + } |
| 81 | + }, |
| 82 | + "tables_kustotable_name": { |
| 83 | + "type": "string", |
| 84 | + "defaultValue": "kustotable", |
| 85 | + "metadata": { |
| 86 | + "description": "Specifies the name of the table" |
| 87 | + } |
| 88 | + }, |
| 89 | + "mapping_kustomapping_name": { |
| 90 | + "type": "string", |
| 91 | + "defaultValue": "kustomapping", |
| 92 | + "metadata": { |
| 93 | + "description": "Specifies the name of the mapping rule" |
| 94 | + } |
| 95 | + }, |
| 96 | + "dataformat_type": { |
| 97 | + "type": "string", |
| 98 | + "defaultValue": "csv", |
| 99 | + "metadata": { |
| 100 | + "description": "Specifies the data format" |
| 101 | + } |
| 102 | + }, |
| 103 | + "dataconnections_kustodc_name": { |
| 104 | + "type": "string", |
| 105 | + "defaultValue": "kustodc", |
| 106 | + "metadata": { |
| 107 | + "description": "Name of the data connection to create" |
| 108 | + } |
| 109 | + }, |
| 110 | + "subscriptionId": { |
| 111 | + "type": "string", |
| 112 | + "defaultValue": "[subscription().subscriptionId]", |
| 113 | + "metadata": { |
| 114 | + "description": "Specifies the subscriptionId of the resources" |
| 115 | + } |
| 116 | + }, |
| 117 | + "resourceGroup": { |
| 118 | + "type": "string", |
| 119 | + "defaultValue": "[resourceGroup().name]", |
| 120 | + "metadata": { |
| 121 | + "description": "Specifies the resourceGroup of the resources" |
| 122 | + } |
| 123 | + }, |
| 124 | + "location": { |
| 125 | + "type": "string", |
| 126 | + "defaultValue": "[resourceGroup().location]", |
| 127 | + "metadata": { |
| 128 | + "description": "Location for all resources." |
| 129 | + } |
| 130 | + } |
| 131 | + }, |
| 132 | + "variables": { |
| 133 | + }, |
| 134 | + "resources": [{ |
| 135 | + "type": "Microsoft.Kusto/Clusters/Databases/DataConnections", |
| 136 | + "apiVersion": "2019-09-07", |
| 137 | + "name": "[concat(parameters('Clusters_kustocluster_name'), '/', parameters('databases_kustodb_name'), '/', parameters('dataconnections_kustodc_name'))]", |
| 138 | + "location": "[parameters('location')]", |
| 139 | + "kind": "EventGrid", |
| 140 | + "properties": { |
| 141 | + "storageAccountResourceId": "[resourceId(parameters('subscriptionId'), parameters('resourceGroup'), 'Microsoft.Storage/storageAccounts', parameters('StorageAccounts_storagedemo_name'))]", |
| 142 | + "eventHubResourceId": "[resourceId(parameters('subscriptionId'), parameters('resourceGroup'), 'Microsoft.EventHub/namespaces/eventhubs', parameters('namespaces_eventhubns_name'), parameters('EventHubs_eventhubdemo_name'))]", |
| 143 | + "consumerGroup": "[parameters('consumergroup_default_name')]", |
| 144 | + "tableName": "[parameters('tables_kustotable_name')]", |
| 145 | + "mappingRuleName": "[parameters('mapping_kustomapping_name')]", |
| 146 | + "dataFormat": "[parameters('dataformat_type')]" |
| 147 | + } |
| 148 | + } |
| 149 | + ] |
| 150 | +} |
| 151 | +``` |
| 152 | + |
| 153 | +[!INCLUDE [data-explorer-clean-resources](../../includes/data-explorer-clean-resources.md)] |
0 commit comments