You can use the Azure Service Bus Connector to retrieve data from devices connected through the Azure IoT Platform.
For more details about Azure Service Bus configuration, refer to this guide.
Note that, the Service Bus connector supports only the Queue mode.
Plugin Configuration
First of all, the Azure Service Bus plugin must be enabled by entering the Administration / Plugins page.

Connector Configuration
Once the plugin has been enabled, for each business entity level (tenant, customer, location, or thing), it is possible to configure the Azure Service Bus Connector.
The connector configuration requires to provide:
- Account Name: the name of the Azure Service Bus account.
- Account Key: the access key configured within the Azure administration console.
- Namespace: the namespace the queue is published to.
- Queue: the name of the queue.
For each unique connection variables set, the connector opens a connection to the Azure Service Bus by using a Connection String composed in this way:
Endpoint=sb://[NAMESPACE].servicebus.windows.net/;SharedAccessKeyName=[ACCOUNT_NAME];SharedAccessKey=[ACCOUNT_KEY]
Once connected, a subscription is established to the queue, and only the messages targeting a known path will be processed by Servitly.
The path of an Azure Service Bus message must be in the following form
<ASSET_ID>/<PATH>/<METRIC_PATH>
Where ASSET_ID and PATH (optional) are specified on the thing mapping, and the METRIC_PATH is specified within the metric mapping (e.g. SN12345/IC2/measures).
The path can be set as the "to" attribute, directly on the Azure Service Bus message, or as the "path" property within the message JSON payload. The path is mandatory to allow Servilty to identify the target thing of the message extracted from the queue.
Messages must be published on the Azure Service Bus by using a JSON payload having the following format:
{ "path": "SN12345/IC2/measures", "ts": 1605179226000, "data": { "metric1": 1234, "metric2": "foobar", "metric3": true } }
The timestamp (ts) in milliseconds is optional, and if omitted the server-side reception time is used instead. Field names within the data node are depending on the metric mapping names.
Parameters and Command Management
Messages addressed from cloud to thing (e.g. commands and configuration-parameters) are addressed to a specific path:
- Configuration Parameter must be published to the "/update" path (e.g. SN12345/IC2/update)
- Commands must be published to the "/command" path (e.g. SN12345/IC2/command)
For this reason, commands and parameters must be mapped on the update or command path respectively. The path is set as the "to" attribute and the "path" property within the message payload.
Comments
0 comments
Please sign in to leave a comment.