Can Azure IOT Edge device connect to the multiple Azure IOT Hubs? - azure

Can we connect Azure IoT Edge Gateway part of multiple Azure IoT Hubs? or Any recommendations to achieve the following multiple hierarchical hubs in the Azure IoT solution?
For example device1, device2 connected to Edge Gateway.
Edge Gateway, device1, device2 -> Root Azure IoT Hub owner
Edge Gateway, Device 1 - IoT Hub 1
Edge Gateway, Device 2 - IoT Hub 2
so that relevant devices message can be forwarded to Hub1, Hub2.

No, as of today one Edge device can only connect to one IoT Hub. To achieve your use case, I would probably use routing in the IoT Hub to forward messages to subsequent Event Hubs, for example with routing based on the device id or some other property that you choose.

with ASA Azure Stream Analytics. in the input of the ASA configure the iothub that receives the data from the iotedge, in the outputs configure the iothubs that need to replicate the data, in the output use for iothub the "Event Hub" and put the "Event Hub compatible endpoint" of iothub.
iotedge -> iothub -> ASA -> multiples iothubs

Related

Azure Device Provisioning to Edge Device

I am trying to figure out how to use DPS to pass down to a device which edge device to connect to. Is this an option to do with DPS or do we have do to this manually?
The DPS is a helper service for IoT hub that will provide the right IoT hub without requiring human intervention
The IoT Hub Device Provisioning Service (DPS) is a helper service for IoT Hub that enables zero-touch, just-in-time provisioning to the right IoT hub without requiring human intervention.
Below are the scenarios in which DPS is an excellent choice for getting devices connected and configured to IoT Hub.
Zero-touch provisioning to a single IoT solution without hardcoding IoT Hub connection information at the factory (initial setup)
Load-balancing devices across multiple hubs
Connecting devices to their owner's IoT solution based on sales transaction data (multitenancy)
Connecting devices to a particular IoT solution depending on use-case (solution isolation)
Connecting a device to the IoT hub with the lowest latency (geo-sharding)
Reprovisioning based on a change in the device
Rolling the keys used by the device to connect to IoT Hub (when not using X.509 certificates to connect)
Here are a few references which have the complete information on DPS.
https://learn.microsoft.com/en-us/azure/iot-dps/about-iot-dps
https://learn.microsoft.com/en-us/azure/iot-dps/

loriot - IoT Central connection

How can I connect devices connected to loriot to Azure IoT Central?
I've got the documentation of connecting it to an Azure IoT Hub, but I'm actually using IoT central, so this seems to work differently.
Log in to the Azure portal (Microsoft Azure account required).
Create a IoT Hub
Copy Shared access primary key from IoT Hub > Settings > Shared
access policies > device
Use this primary key and the IoT Hub Name to configure your LORIOT
application output
From IoT Hub > Explorers > IoT devices: create a device using the
Device EUI as Device ID
Messages will have the following format:
https://docs.loriot.io/display/LNS5/Uplink+Data+Message
Loroiot setup only allows "IoT Hub Name" & "Primary Key" which IoT Central application does not expose unless a Device Provisioning Call is made to it from device or API. It is possible to get the device key from Azure CLI or IoT Central portal, but IoTHub name is only via the DPS call.
One option is to get this IoTHub name seperately and then configure Loroiot, but in case of HA/DR the IoTHub name could change (IoT Central manages multiple IoTHubs for HA/DR and scale).
In absence of Loroiot having this functionality, check if its API allows configuration then orchestrate provisioning via script, function, etc.
https://learn.microsoft.com/en-us/rest/api/iot-dps/device/runtime-registration

IoT hub to Azure Edge

Is it possible to control a Azure Edge device through IoT hub, eg. I would like to request "an image data/ control a led connected to as IoT device to the Azure Edge runtime through IoT hub.
The Flow would be, IoT hub -- Azure Edge -- IoT device (Led sensor)..
I want to control LeD through Edge from IoT hub or by any means.
All the Cloud-2-Device messaging features to leaf devices also work when you connect the device through an IoT Edge device as a transparent gateway.
https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-messages-c2d
https://learn.microsoft.com/en-us/azure/iot-edge/iot-edge-as-gateway

How to subscribes to topic on mqtt broker with Azure IOT HUB as i want the data to be stored in Azure iot hub when I published my topic

im new to mqtt and currently trying to setup a mqtt protocol to send data from a gateway devices to azure iot hub. The problem i facing was I couldn't figure out which way that I can received and store data on IoT Hub when i published my data on mqtt broker. The textbook way is to subscribe the mqtt broker using Azure IOT Hub but how should I do it?
Assuming I am doing testing using a laptop
Read data stored in json file -> published to topic "data/device1" -> Data stored in Azure IoT Hub
I tried reading the Azure IoT HUB MQTT Connections but it doesnt work out for me. PLease Help
By default Azure IoT Hub makes incoming telemetry messages available on its Event Hub-compatible endpoint: https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-messages-read-builtin It does not matter over which protocol (MQTT, AMQP or HTTPS) you sent in the messages to IoT Hub - they all will land in that endpoint.
From there you can read the information using HTTPS or AMQP. I would recommend to use the Event Hub SDK or use a stream processing service like Azure Stream Analytics or Spark Streaming, which supports Event Hub directly.

Does Microsoft IoT Central send data through an Azure IoT Hub...?

I am just reading up on the new IoT Central, currently in preview.
Our customers seldom let their devices connect to cloud by themselves,
but are rather connected to some kind of management system that in turn connects to Azure.
We however consider using IoT Central for demo purposes and would like to know if devices defined in IoT Central sends their data to an IoT Hub of choice or if is handled in any other way behind the scenes?
Microsoft IoT Central does use an IoT Hub internally. If you look here you can see that when you add a physical device to an IoT Central application it generates an IoT Hub device connection string: https://learn.microsoft.com/microsoft-iot-central/tutorial-add-device#get-connection-string-for-real-device-from-application.
However, you cannot get admin access to the IoT Hub or use an IoT Hub of your own choosing - all you have is the device connection string.

Resources