Skip to content

Cookie preferences

We use cookies for our own analytics, to see how our campaigns perform and, if you allow it, to load content from other services such as the Google site search. We never sell your data. Necessary cookies keep the site working and cannot be switched off. See our Cookie Policy for details and our Privacy Policy for how we handle personal data.

Security, load balancing and remembering your cookie choice.

Show us which pages people read, how they find the site and where they get stuck, so we can improve it (Google Analytics, Microsoft Clarity).

Show us which of our ad campaigns bring visitors to the site and remember the campaign or partner link you arrived from (Google Ads, LinkedIn, Meta, partner program). We do not use these cookies to build advertising profiles.

Load the site search from Google when you use it. Google sets its own cookies and shows ads in the search results.

© 2026 The ThingsBoard Authors
22.5k Try for free

ThingsBoard Cloud

Choose your data region

Your data stays in the region you choose, for residency and compliance. No credit card required.

Rather run it yourself? Install on your own servers

Azure IoT Hub

Use this node to publish messages to Azure IoT Hub via MQTT — for example, forwarding device telemetry collected in ThingsBoard to an Azure IoT Hub for processing by Azure Stream Analytics, or sending device-to-cloud messages to trigger Azure Functions.

  • Topic pattern — MQTT topic. Default: devices/{clientId}/messages/events/. Supports templatization.
  • Host — Azure IoT Hub hostname: {iot-hub-name}.azure-devices.net.
  • Client ID — the device ID as registered in Azure IoT Hub.
Type Required fields
SAS Token sasKey (primary or secondary key); optional caCert
PEM Certificate Client cert + privateKey; optional caCert and key password

Exponential backoff with jitter for unacknowledged QoS 1 messages:

Variable Default
TB_MQTT_CLIENT_RETRANSMISSION_MAX_ATTEMPTS 3
TB_MQTT_CLIENT_RETRANSMISSION_INITIAL_DELAY_MILLIS 5000
TB_MQTT_CLIENT_RETRANSMISSION_JITTER_FACTOR 0.15
  1. Resolve the topic pattern from message data and metadata.
  2. Publish the message data to IoT Hub via MQTT with QoS 1.
  3. On acknowledgment: route via Success.
  4. On error: add error to metadata; route via Failure.
Connection Condition
Success Message published and acknowledged by IoT Hub.
Failure Authentication failure, retransmission exhausted, or unexpected error. Error details in metadata error key.

Example 1 — Forward telemetry to IoT Hub

Section titled “Example 1 — Forward telemetry to IoT Hub”

Data: { "temperature": 22.5, "humidity": 65 }.

{
"topicPattern": "devices/sensor-001/messages/events/",
"host": "my-hub.azure-devices.net",
"clientId": "sensor-001",
"credentials": {
"type": "sas",
"sasKey": "base64encodedKey=="
}
}

Result: message published to IoT Hub. Routes via Success.

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "TbAzureIotHubNodeConfiguration",
"type": "object",
"required": ["topicPattern", "host", "clientId", "credentials"],
"additionalProperties": false,
"properties": {
"topicPattern": { "type": "string" },
"host": { "type": "string" },
"clientId": { "type": "string" },
"connectTimeoutSec": { "type": "integer" },
"credentials": { "type": "object" }
}
}