title | description | services | author | ms.author | ms.date | ms.topic | ms.service |
---|---|---|---|---|---|---|---|
Export data to Webhook |
Learn how to use the IoT Central data export capability to continuously export your IoT data to Webhook |
iot-central |
dominicbetts |
dobett |
10/14/2024 |
how-to |
azure-iot-central |
This article describes how to configure data export to send data to the Webhook.
[!INCLUDE iot-central-data-export]
For Webhook destinations, IoT Central exports data in near real time. The data in the message body is in the same format as for Event Hubs and Service Bus.
You can export data to a publicly available HTTP Webhook endpoint. You can create a test Webhook endpoint using RequestBin. RequestBin throttles request when the request limit is reached:
-
Navigate to RequestBin.
-
Select Create a RequestBin.
-
Sign in with one of the available methods.
-
Copy the URL of your RequestBin You use this URL when you test your data export.
To create the Azure Data Explorer destination in IoT Central on the Data export page:
-
Select + New destination.
-
Select Webhook as the destination type.
-
Paste the callback URL for your Webhook endpoint. You can optionally configure Webhook authorization and add custom headers.
- For OAuth2.0, only the client credentials grant flow is supported. When you save the destination, IoT Central communicates with your OAuth provider to retrieve an authorization token. This token is attached to the
Authorization
header for every message sent to this destination. - For Authorization token, you can specify a token value that's directly attached to the
Authorization
header for every message sent to this destination.
- For OAuth2.0, only the client credentials grant flow is supported. When you save the destination, IoT Central communicates with your OAuth provider to retrieve an authorization token. This token is attached to the
-
Select Save.
This example shows how to configure a Webhook destination to use an Azure Function App that's protected by using Microsoft Entra sign-in:
Setting | Example | Notes |
---|---|---|
Destination type | Webhook | |
Callback URL | https://myapp.azurewebsites.net/api/HttpExample |
The function URL. |
Authorization | OAuth 2.0 | |
Token URL | https://login.microsoftonline.com/your-tenant-id/oauth2/v2.0/token |
The URL to use to retrieve a token. You can find this value in your Function App: Authentication > Your Microsoft Identity provider > Endpoints > OAuth 2.0 token endpoint (v2) |
Client ID | your-client-id |
The client ID of your Function App. You can find this value in your Function App: Authentication > Your Microsoft Identity provider > Application (client) ID |
Client secret | your-client-secret |
The client secret of your Function App. You can find this value in your Function App: Authentication > Your Microsoft Identity provider > Certificates & secrets |
Audience | N/A | Blank if you're using a Function App. |
Scope | https://your-client-id/.default |
The scope of the token. For a Function App, use the client ID value.** |
Token request content type | Auto |
Other webhook destinations might require different values for these settings.
[!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 Service Bus, a suggested next step is to learn Export to Event Hubs.