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
| Skill | What it does |
|---|---|
azure-iot-hub-migration-planner | Inventories 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-executor | Verifies 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. |
| Script | Purpose |
|---|---|
azure_devices_to_connectmq.py | Device-identity export → device report (SAS / X.509 / IoT Edge), clients.csv, ACL rules for the new topic scheme. |
azure_twins_to_retained.py | Twin export → retained devices/{id}/twin/desired and .../reported messages. |
eventhub_relay.py | Reads IoT Hub telemetry from the Event Hubs-compatible endpoint and publishes it to ConnectMQ. |
relay.py | Generic MQTT-to-MQTT relay (edge brokers, Event Grid MQTT namespaces). |
client_id_map.py, verify_connectmq.py, copy_retained.py, compare_streams.py | See 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-migrationHow the migration runs
- 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.
- Relay:
eventhub_relay.pycopies telemetry of devices still on IoT Hub to ConnectMQ; twins are published as retained state. - Back ends first: consumers subscribe on ConnectMQ; command senders publish there (with a reverse worker for devices still on IoT Hub).
- 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.
- Cutover: stop the relay, keep identities for the rollback window, decommission the hub.
What changes
| Azure IoT Hub | ConnectMQ |
|---|---|
| SAS tokens / X.509 | Username and password over TLS; client ID <ISSUED_ID>_<deviceId> |
devices/{id}/messages/events/ | Your own topic tree (topic design) |
| Device twins | Retained devices/{id}/twin/desired and .../reported topics |
| Direct methods | MQTT 5 request/response (response topic + correlation data) |
| Event Hubs routes and consumers | MQTT subscribers, scaled with shared subscriptions |
| IoT Edge | Not 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."