Microsoft Azure IoT Connector

Connecting Azure IoT Hub to the Waylay broker

Prerequisites

  • Access to IoT Hub
  • IoT connected device
  • Waylay environment

Main building blocks of this integration are presented below: architecture

Abstract

Say your organisation has some devices that are connected in Azure IoT Hub and that the devices are configured to push their telemetry data to a Topic or multiple Topics. How does one connect this data on these topic to a Waylay Environment for creating rules and templates? The service connector allows you to bridge the connection between Azure IoT Hub and your Waylay environment fairly easy!

All one needs to do is to download this service connector as a Docker image and run it with a file that contains the environment variables.

The command for running the docker is as followed:

docker run -p 3000:3000 --rm --name connector --env-file=PathToFile/connectorFile awsIoTConnectorDockerImage

Create a file and insert the configurable variables listed below.

Azure Connector Docker configuration

The following environment variables have to be configured:

Var Default Description
PORT 3000 Port
CONNECTION_STRING IoT Hub Connection string
PARSE_MODE Flattening JSON objects or not (value can be ‘flat’ or not filled in)
PATH_FILTER Filter on device module name
TENANT_ID TenantId of your organisation
APPLICATION_SECRET Secret of your application
APPLICATION_ID Id of your application
AUTH_URL Waylay accounts url
BROKER_URL URL of your broker

CONNECTION_STRING


Exist of multiple pieces of information:

HostName= ;Endpoint= ;SharedAccessKeyName= ;SharedAccessKey= ;

HostName can be found on:

IoT Hub Console -> Overview -> Hostname

Endpoint - SharedAccessKeyName - SharedAccessKey String can be found on:

IoT Hub Console -> Endpoints -> Events (Built-in Endpoint) -> Properties

endpoint

AUTH_URL


This will be the same url as configured in your waylay environment.

PARSE_MODE


This will convert nested JSON objects into flat (key, value) objects so that all metric are stored in the timeseries database.

value : PARSE_MODE='flat' or not specified

PATH_FILTER


Example:

Azure IOT Hub “Module” # Devices
A 25
B 40

If PATH_FILTER has value of A the engine will only retrieve data of devices that have module A assigned.

If PATH_FILTER is not injected it will retrieve all data of all modules (all devices).

Modules can be configured for each device

modules