ThingWorx Azure IoT Hub Connector > What is the ThingWorx Azure IoT Hub Connector?
What is the ThingWorx Azure IoT Hub Connector?
The ThingWorx Azure IoT Hub Connector integrates Edge devices, which use a Microsoft Azure IoT SDK and send telemetry to an Azure IoT Hub, with the ThingWorx Platform. As of the 4.0.0 release of the Connector, it can be configured to forward OPC UA data that has been sent from any OPC UA Server, such as ThingWorx Kepware Server (TKS), via Microsoft Azure Industrial IoT (IIoT) Microservices to a ThingWorx Platform. For information about setting up to use this integration, refer to the section, ThingWorx Azure IoT Hub Connector for Microsoft Azure Industrial IoT (IIoT) for OPC UA .
As of the 4.1.0 release, you can configure the Connector to operate in a ThingWorx High Availability (HA) Clustering environment. You can set up the Connector for HA mode whether you are using the Azure Industrial IoT OPC UA integration or using Azure IoT SDKs to connect Edge devices to ThingWorx. For information on using the Connector in an HA environment, refer to ThingWorx Azure IoT Hub Connector in a ThingWorx High Availability Cluster.
An installation of the ThingWorx Azure IoT Hub Connector consists of the following components:
The ThingWorx Azure IoT Hub Connector, which handles translation of messages as well as communication between an Azure IoT Hub and an instance of ThingWorx Platform, either as a single-server instance or as an instance in a ThingWorx HA cluster. The support for OPC UA telemetry includes translation of the telemetry and communication with a single-server instance of the platform only. It cannot be used in a ThingWorx HA cluster.
An Azure IoT Extension that adds Azure-specific entities when imported into an instance of ThingWorx Platform.For the ThingWorx Azure Industrial IoT OPC UA integration, the extension also provides the mashups for configuring OPC UA applications and endpoints.
The ThingWorx Connection Services Extension, which provides the Connection Services Hub.
Once you have installed, configured, and started the ThingWorx Platform, you can use ThingWorx Composer to add and configure your Azure IoT Hub that will communicate with the Connector, using the AzureIotHubTemplate Thing Template. Once the AzureIotHubTemplate Thing is configured, you need to add the Thing name of the Hub to the configuration file for your Connector. For more information about configuring Azure IoT Things in Composer, refer to Step 5. Create Azure IoT Entities in ThingWorx Composer.
Once you configure devices to connect with the Azure IoT Hub, the Azure IoT Hub Connector detects the data and pushes it to the ThingWorx Platform. By pushing data to ThingWorx, you can take advantage of its features for developing projects quickly and easily. For example, you can use ThingWorx Composer and Mashup Builder to model your Things and build user interfaces and applications, or use the data in ThingWorx Analytics to analyze data and generate reports. Connecting to ThingWorx enables you to fully interact with these devices and use the data to transform your business.
Azure IoT Edge Devices vs Azure IoT Devices
Azure IoT Edge devices do not provide any mechanism to indicate device connection to the IoT Hub reliably. While there is a connected property in the device/module twin, Microsoft has explicitly stated that those values are not reliable and not intended for production use - just for debugging. Microsoft recommends Edge developers create their own mechanism for announcing connectivity of their Edge devices. This could take the form of a heartbeat message or some other mechanism. Keep in mind that there may be costs involved with chatty connectivity protocols.
Azure IoT Edge devices behave differently than Azure IoT Devices and may not communicate with asynchronous inbound messaging in the same way through the Azure IoT Hub. Specifically, Azure IoT Edge devices contain edge modules that have no Cloud-to-Modules (C2M) messaging capability but do have a Module-to-Cloud (M2C) capability as well as direct method invocation when directly connected to the Azure IoT Hub. Cloud-to-Device (C2D) messaging and Device-to-Cloud (D2C) messaging are available for both Azure IoT Edge devices as well as Azure IoT Devices.
Azure IoT Hub and Group Binding
The Azure IoT Hub Connector uses a routing group name when binding the Azure IoT Hub to its corresponding Thing in the ThingWorx Platform. The outbound messaging or egress destined for the Azure IoT Hub and the Azure IoT devices and Azure IoT Edge devices associated with the hub are randomly distributed to all the connectors that perform the group bind. By default, the Azure IoT Hub Connector supports binding the Azure IoT Hub using the hub-thing-name of the Azure IoT Hub Thing as the name of the routing group. You do not need to change this setting unless you need to use a different name.
If the routing-group is set to null or an empty String, then this configuration setting is rejected and the Connector does not start up.
At runtime, the Connector invokes a service that retrieves the value of the routing group configuration setting and uses it to bind the Azure IoT Hub. This effectively binds all of the Azure IoT Devices and Azure IoT Edge devices to their corresponding Things.