| title | Export data to Azure Data Explorer |
|---|---|
| description | Learn how to use the IoT Central data export capability to continuously export your IoT data to Azure Data Explorer |
| services | iot-central |
| author | dominicbetts |
| ms.author | dobett |
| ms.date | 08/06/2025 |
| ms.topic | how-to |
| ms.service | azure-iot-central |
| ms.custom | sfi-image-nochange |
This article describes how to configure data export to send data to the Azure Data Explorer.
[!INCLUDE iot-central-data-export]
You can use an Azure Data Explorer cluster or an Azure Synapse Data Explorer pool. To learn more, see What is the difference between Azure Synapse Data Explorer and Azure Data Explorer?
IoT Central exports data in near real time to a database table in the Azure Data Explorer cluster. The data is in the message body and is in JSON format encoded as UTF-8. You can add a Transform in IoT Central to export data that matches the table schema.
To query the exported data in the Azure Data Explorer portal, navigate to the database and select Query.
The following video walks you through exporting data to Azure Data Explorer:
[!VIDEO https://aka.ms/docs/player?id=9e0c0e58-2753-42f5-a353-8ae602173d9b]
Azure Data Explorer destinations let you configure the connection with a service principal or a managed identity.
[!INCLUDE iot-central-managed-identities]
This article shows how to create a managed identity using the Azure CLI. You can also use the Azure portal to create a managed identity.
If you don't have an existing Azure Data Explorer database to export to, follow these steps. You have two choices to create an Azure Data Explorer database:
- Create a new Azure Data Explorer cluster and database. To learn more, see the Azure Data Explorer quickstart. Make a note of the cluster URI and the name of the database you create, you need these values in the following steps.
- Create a new Azure Synapse Data Explorer pool and database. To learn more, see the Azure Data Explorer quickstart. Make a note of the pool URI and the name of the database you create, you need these values in the following steps.
To configure the managed identity that enables your IoT Central application to securely export data to your Azure resource:
-
Create a managed identity for your IoT Central application to use to connect to your database. Use the Azure Cloud Shell to run the following command:
az iot central app identity assign --name {your IoT Central app name} \ --resource-group {resource group name} \ --system-assignedMake a note of the
principalIdandtenantIdoutput by the command. You use these values in the following step. -
Configure the database permissions to allow connections from your IoT Central application. Use the Azure Cloud Shell to run the following command:
az kusto database-principal-assignment create --cluster-name {name of your cluster} \ --database-name {name of your database} \ --resource-group {resource group name} \ --principal-assignment-name {name of your IoT Central application} \ --principal-id {principal id from the previous step} \ --principal-type App --role Admin \ --tenant-id {tenant id from the previous step}[!TIP] If you're using Azure Synapse, see
az synapse kusto database-principal-assignment. -
Create a table in your database with a suitable schema for the data you're exporting. The following example query creates a table called
smartvitalspatch. To learn more, see Transform data inside your IoT Central application for export:.create table smartvitalspatch ( EnqueuedTime:datetime, Message:string, Application:string, Device:string, Simulated:boolean, Template:string, Module:string, Component:string, Capability:string, Value:dynamic )
-
(Optional) To speed up ingesting data into your Azure Data Explorer database:
-
Navigate to the Configurations page for your Azure Data Explorer cluster. Then enable the Streaming ingestion option.
-
Run the following query to alter the table policy to enable streaming ingestion:
.alter table smartvitalspatch policy streamingingestion enable
-
To create the Azure Data Explorer destination in IoT Central on the Data export page:
-
Select + New destination.
-
Select Azure Data Explorer as the destination type.
-
Enter your Azure Data Explorer cluster or pool URL, database name, and table name. Select System-assigned managed identity as the authorization type.
[!TIP] The cluster URL for a standalone Azure Data Explorer looks like
https://<ClusterName>.<AzureRegion>.kusto.windows.net. The cluster URL for an Azure Synapse Data Explorer pool looks likehttps://<DataExplorerPoolName>.<SynapseWorkspaceName>.kusto.azuresynapse.net.:::image type="content" source="media/howto-export-data/export-destination-managed.png" alt-text="Screenshot of Azure Data Explorer export destination that uses a managed identity.":::
If you don't see data arriving in your destination service, see the sections related to data export issues in Troubleshooting in Azure IoT Central.
If you don't have an existing Azure Data Explorer database to export to, follow these steps:
-
You have two choices to create an Azure Data Explorer database:
- Create a new Azure Data Explorer cluster and database. To learn more, see the Azure Data Explorer quickstart. Make a note of the cluster URI and the name of the database you create, you need these values in the following steps.
- Create a new Azure Synapse Data Explorer pool and database. To learn more, see the Azure Data Explorer quickstart. Make a note of the pool URI and the name of the database you create, you need these values in the following steps.
-
Create a service principal that you can use to connect your IoT Central application to Azure Data Explorer. Use the Azure Cloud Shell to run the following command:
az ad sp create-for-rbac --skip-assignment --name "My SP for IoT Central" --scopes /subscriptions/<SubscriptionId>Make a note of the
appId,password, andtenantvalues in the command output, you need them in the following steps. -
To add the service principal to the database, navigate to the Azure Data Explorer portal and run the following query on your database. Replace the placeholders with the values you made a note of previously:
.add database ['<YourDatabaseName>'] admins ('aadapp=<YourAppId>;<YourTenant>');
-
Create a table in your database with a suitable schema for the data you're exporting. The following example query creates a table called
smartvitalspatch. To learn more, see Transform data inside your IoT Central application for export:.create table smartvitalspatch ( EnqueuedTime:datetime, Message:string, Application:string, Device:string, Simulated:boolean, Template:string, Module:string, Component:string, Capability:string, Value:dynamic )
-
(Optional) To speed up ingesting data into your Azure Data Explorer database:
-
Navigate to the Configurations page for your Azure Data Explorer cluster. Then enable the Streaming ingestion option.
-
Run the following query to alter the table policy to enable streaming ingestion:
.alter table smartvitalspatch policy streamingingestion enable
-
To create the Azure Data Explorer destination in IoT Central on the Data export page:
-
Select + New destination.
-
Select Azure Data Explorer as the destination type.
-
Enter your Azure Data Explorer cluster or pool URL, database name, and table name. The following table shows the service principal values to use for the authorization:
Service principal value Destination configuration appId ClientID tenant Tenant ID password Client secret [!TIP] The cluster URL for a standalone Azure Data Explorer looks like
https://<ClusterName>.<AzureRegion>.kusto.windows.net. The cluster URL for an Azure Synapse Data Explorer pool looks likehttps://<DataExplorerPoolName>.<SynapseWorkspaceName>.kusto.azuresynapse.net.:::image type="content" source="media/howto-export-data/export-destination.png" alt-text="Screenshot of Azure Data Explorer export destination that uses a service principal.":::
[!INCLUDE iot-central-data-export-setup]
[!INCLUDE iot-central-data-export-message-properties]
[!INCLUDE iot-central-data-export-device-connectivity]
[!INCLUDE iot-central-data-export-device-lifecycle]
[!INCLUDE iot-central-data-export-device-template]
[!INCLUDE iot-central-data-export-audit-logs]
Now that you know how to export to Azure Data Explorer, a suggested next step is to learn how to export IoT data to Webhook.