IoT Hub provider
The IoT Hub provider connects an Azure IoT Hub to Beacon Tower. Devices talk to the hub with the Azure IoT device SDKs or plain MQTT/AMQP, as they always did. The provider reads the hub's built-in endpoint, forwards device data into the platform, and carries desired properties and direct methods back to the devices.
It is built on the Provider SDK, so provisioning, twins, commands and device identity work the same way as for the MQTT provider. This page covers what is specific to IoT Hub.
What a device needs
A device is provisioned through the platform first (see Your first asset via the API). The provider creates the device identity on the hub. The provider client's providerData then has:
| Key | Meaning |
|---|---|
hostName | The hub's host name |
primaryKey, secondaryKey | The device keys in the form IoT Hub uses |
primaryConnectionString, secondaryConnectionString | Ready-to-use device connection strings |
authenticationType | sas for symmetric keys, certificateAuthority for CA-signed certificates |
Give the device its connection string, or its host name, device id and key. The device id in the hub is the provider client id.
What the provider forwards
| Device action on the hub | Result in Beacon Tower |
|---|---|
| Sends a device-to-cloud message with a JSON body | Telemetry for the device, with the hub's enqueued time as the message time. A JSON array becomes one message per element. |
| Updates reported properties | The whole reported document is forwarded as a property change. |
| Connects or disconnects | The system signal bt_connectedState, the device status, and a device.connected or device.disconnected event. |
Telemetry payload
Send a flat JSON object. Each key is a signal name on the asset's model:
{"temperature": 25.5, "humidity": 60.0, "timestamp": "2026-02-12T12:00:00Z"}
timestamp is optional. If present, it is the telemetry time. If absent, the hub's enqueued time is used. Set the message content type to application/json. A body that is not JSON is dropped and counted; it does not stop later messages.
If the device uses a different payload format (for example OBIS energy meter data), set a provider template with the right parser when provisioning. The parser is applied by the platform, not by the device.
Twins and direct methods
- Desired properties set in Beacon Tower are written to the hub twin. The hub delivers them when the device is connected, and stores them for a device that is offline.
- Reported properties the device writes to the hub twin arrive in Beacon Tower as the device's reported document.
- Direct methods invoked in Beacon Tower are called on the device through the hub. The device must be connected; the hub does not queue methods. The platform's command timeout applies, up to the hub's 300 second limit.
Delivery guarantee
Delivery from the hub into the platform is at least once. The provider moves its reading position on the hub forward only after the platform's ingress stream has acknowledged the messages. If the provider restarts, it continues from the last acknowledged position, so no message is lost.
Because of this, a message can arrive twice after a restart. Each message carries a stable id made from its position on the hub, and the platform drops a repeated id inside its duplicate window. A duplicate outside the window is stored twice; downstream processing must tolerate repeated points.
Delivery from the device to the hub is the device's responsibility. A device must:
- send with acknowledgement (QoS 1 over MQTT, or the AMQP equivalent, which the Azure device SDKs do by default),
- buffer messages while the hub is unreachable and send them when the connection returns,
- put the measurement time in the payload (
timestamp), so a buffered message keeps its real time.
The hub keeps unread messages for the retention time configured on it (7 days by default in Beacon Tower deployments). If the provider is down longer than that, the oldest messages are lost.
Not supported
- Writing directly to the input Event Hub. The previous provider accepted application-to-cloud writes on an Event Hub. The new provider reads the hub only. Applications use the platform API or a custom provider.
- IoT Edge devices and modules. Module-scoped messages are ignored; Edge devices are skipped by the import.
- Cloud-to-device messages (C2D). Use desired properties or direct methods.
Operations
One provider instance serves one hub. A tenant with several hubs runs several provider instances, each with its own provider id. The hub needs a shared access policy for the provider (registry read and write, service connect), a consumer group on the built-in endpoint that is not $Default, and routes for device messages, twin change events and connection state events to the built-in endpoint. The platform operations team configures this when a hub is connected.