Skip to content

Migrate from Azure IoT Hub ​

The Azure IoT Hub migration skills inventory your IoT Hub registry, flag X.509 and IoT Edge blockers, redesign IoT Hub's fixed device topics into a standard MQTT topic tree, turn twins into retained state, relay IoT Hub telemetry to ConnectMQ so back ends can move first, then roll devices over in waves.

What the skills do ​

SkillWhat it does
azure-iot-hub-migration-plannerInventories devices, auth types, twins, routes and SDK usage with the az CLI; measures the workload from Azure Monitor; maps IoT Hub topics, twins and direct methods to a ConnectMQ topic scheme; generates client IDs and ACL rules; plans back-end replacements; writes migration/plan.md.
azure-iot-hub-migration-executorVerifies ConnectMQ, publishes twins as retained state, runs the Event Hubs relay, moves back ends from Event Hubs and the service SDK to MQTT, runs device waves, rolls back, decommissions IoT Hub; keeps migration/log.md.
ScriptPurpose
azure_devices_to_connectmq.pyDevice-identity export → device report (SAS / X.509 / IoT Edge), clients.csv, ACL rules for the new topic scheme.
azure_twins_to_retained.pyTwin export → retained devices/{id}/twin/desired and .../reported messages.
eventhub_relay.pyReads IoT Hub telemetry from the Event Hubs-compatible endpoint and publishes it to ConnectMQ.
relay.pyGeneric MQTT-to-MQTT relay (edge brokers, Event Grid MQTT namespaces).
client_id_map.py, verify_connectmq.py, copy_retained.py, compare_streams.pySee the overview.

The Event Hubs relay also needs pip install -r requirements-azure.txt.

Install ​

text
/plugin marketplace add connectmq/azure-iot-hub-migration-skills
/plugin install azure-iot-hub-migration-skills@connectmq-azure-iot-hub-migration

How the migration runs ​

  1. Plan: inventory the registry and twins, measure Azure Monitor metrics, check plan limits, design topics, map credentials, client IDs and ACLs, list back-end replacements, choose waves.
  2. Relay: eventhub_relay.py copies telemetry of devices still on IoT Hub to ConnectMQ; twins are published as retained state.
  3. Back ends first: consumers subscribe on ConnectMQ; command senders publish there (with a reverse worker for devices still on IoT Hub).
  4. Devices in waves: firmware or configuration with the new host, credentials, client ID and topics, keeping IoT Hub as fallback until the wave has soaked.
  5. Cutover: stop the relay, keep identities for the rollback window, decommission the hub.

What changes ​

Azure IoT HubConnectMQ
SAS tokens / X.509Username and password over TLS; client ID <ISSUED_ID>_<deviceId>
devices/{id}/messages/events/Your own topic tree (topic design)
Device twinsRetained devices/{id}/twin/desired and .../reported topics
Direct methodsMQTT 5 request/response (response topic + correlation data)
Event Hubs routes and consumersMQTT subscribers, scaled with shared subscriptions
IoT EdgeNot supported as is; see ConnectMQ Edge for PLC/OPC UA gateways

Example prompts ​

  • "We have 400 devices on Azure IoT Hub with twins and direct methods. Plan a move to ConnectMQ."
  • "Here is our device-identity export. Which devices block a migration away from IoT Hub?"
  • "Map our IoT Hub twin and direct method topics to a ConnectMQ topic tree."
  • "Rewrite this Event Hubs consumer as an MQTT shared-subscription worker."

Fully managed MQTT broker for connected devices.