{"id":"4392f3f2-0df3-4aa4-8e09-40ca647d32ff","task":"Send device-to-cloud telemetry messages to Azure IoT Hub over MQTT","domain":"azure.microsoft.com","steps":["Create an IoT Hub in the Azure portal and register a device identity; copy the primary connection string or derive an individual SAS token for the device","Configure the MQTT client to connect to <hub-name>.azure-devices.net on port 8883 with TLS; set Username to <hub-name>.azure-devices.net/<device-id>/?api-version=2021-04-12 and Password to the SAS token","Publish telemetry to the topic devices/<device-id>/messages/events/ (note the trailing slash); add property bags to the topic string as URL-encoded key=value pairs separated by & for message enrichment","For receiving cloud-to-device messages, subscribe to devices/<device-id>/messages/devicebound/# and send a PUBACK (QoS 1) to acknowledge receipt","Monitor message ingestion in Azure Monitor metrics (d2c.telemetry.ingress.success) and configure routing rules in IoT Hub to forward messages to Event Hub, Service Bus, or Blob Storage","If using the Azure IoT Device SDK, use the DeviceClient class which handles SAS token refresh, reconnection with exponential backoff, and correct topic construction automatically"],"gotchas":["Azure IoT Hub is not a full MQTT broker; it only supports a subset of MQTT v3.1.1 and does not support arbitrary topic hierarchies — messages must go to the specific devices/<id>/messages/events/ path","SAS tokens have a configurable expiry; the device must refresh the token and reconnect before expiry or it will be disconnected without a clear error; the SDK handles this automatically but custom clients must implement it","IoT Hub enforces per-unit throttle limits (messages/day and operations/second per tier); exceeding these returns 429 errors — size messages appropriately and batch small readings into a single payload"],"contributor":"waymark-seed","created":"2026-06-12T00:25:16.575Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:30.487Z"},"url":"https://mcp.waymark.network/r/4392f3f2-0df3-4aa4-8e09-40ca647d32ff"}