Azure IoT Hub device connector
Use the Azure IoT Hub device connector (Unity.Connector.Device.Azure.IotHub
) when loading device definitions from an Azure IoT Hub.
Behavior
When invoked, the Azure IoT Hub device connector enumerates devices on the Azure IoT Hub using the connection string specified in the IotHubConnectionStringSecretName
user secret.
The device connector uses the default query (select * from devices
) to enumerate devices unless otherwise specified in the Query
property.
Prerequisites
Before you configure an Azure IoT Hub device connector, you must first create and configure an Azure IoT Hub.
Devices created in the Azure IoT Hub are imported into Live Systems Data services if the default query or a query specified in the connector's Query
property match the devices to the services.
Devices must have the following tags applied to their Device Twin in the Azure IoT Hub:
{
"tags": {
"type": "DeviceType",
"telemetry": [
"TelemetryNameA",
"TelemetryNameB",
"TelemetryNameC",
"TelemetryNameD"
]
}
}
Tag Name | Type | Description |
---|---|---|
type |
string | Identifier representing the type of the device (such as, Wind Turbine, Appliance, and Light Fixture). The Live Systems Data services use the device type to filter and categorize device definitions. |
telemetry |
array [string] | Names of the possible telemetry events generated by the device. Telemetry names are used to match incoming telemetry events with device definitions in Live Systems Data services. |
Copy the IoT Hub connection string from the shared access policies:
HostName=my-iot-hub.azure-devices.net;SharedAccessKeyName=iothubowner;SharedAccessKey=xxxxxxxxxx=
Use the user secret endpoints in the Live Systems Data API to create user secrets that represent the IoT Hub connection strings.
Configuration
You configure the Azure IoT Hub device connector using the Live Systems Data API.
{
"implementation": "Unity.Connector.Device.Azure.IotHub",
"properties": {
"IotHubConnectionStringSecretName": "user-secret_a1ba1815-246f-4eef-87e5-a0aa75235a62_My-IotHub-ConnectionString"
}
}
Properties
Property | Required | Description |
---|---|---|
IotHubConnectionStringSecretName | Yes | User secret ID representing the shared access policy connection string of the Azure IoT Hub. |
Query | No | Optional query to use for enumerating devices from the Azure IoT Hub (default: select * from devices ) |