Skip to content

Latest commit

 

History

History
79 lines (50 loc) · 4.2 KB

howto-export-to-webhook.md

File metadata and controls

79 lines (50 loc) · 4.2 KB
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

Export IoT data to Webhook

This article describes how to configure data export to send data to the Webhook.

[!INCLUDE iot-central-data-export]

Set up a Webhook export destination

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.

Create a Webhook destination

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:

  1. Navigate to RequestBin.

  2. Select Create a RequestBin.

  3. Sign in with one of the available methods.

  4. 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:

  1. Select + New destination.

  2. Select Webhook as the destination type.

  3. 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.
  4. Select Save.

Example OAuth 2.0 configuration

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]

Next steps

Now that you know how to export to Service Bus, a suggested next step is to learn Export to Event Hubs.