Links

Example

This example demonstrates how to use this Action Agent to send simple pump data readings to Azure Digital Twins. This would allow current data to be stored for later retrieval for contextualization.
Refer to configuration to understand all configuration options of this Agent.

Step 1: Add the Agent

Drag the Azure Digital Twin Action Agent onto the canvas, link the input endpoint to pump readings. Rename the Agent and save the Data Stream.

Step 2: Configure General

Select the Agent and click Configure. In this case, keep the default Collection.

Step 3: Configure Authentication

Tick to use variables. Set the Subscription Id, Tenant Id, Client Id and Client Secret.

Step 4: Create a Digital Twin (optional)

Refer Azure resource creation on how to enable this link, or skip to step 5.
We're going to create a Digital Twins instance. Go to setting the Digital Twins Host Name if you want to skip this step.
Click 'Create new resource' to open the Create New Resource blade.
Set the Resource Location, Resource Group, and Digital Twins Instance Name.
In this case, set Resource Location to australiaeast, Resource Group to XMDocs, and Digital Twins Instance Name to XMDTExample. Click Setup Infrastructure.
Apply the changes on the Create New Resource blade.

Step 5: Configure Digital Twin

Set the Host Name to the Azure Digital Twin Host Name variable.
Click Upload new model.
Click Select File and select the DTDL Model file. Apply the changes.
Set Model Name to Pump.
Set Twin Id to PumpId.
Apply the changes and save the Data Stream.

Step 6: Input Mapping

Select the Azure Digital Twin's input arrow and click Configure.
Map one of the parent Agent's output attributes to each model attribute, which is fetched from the Azure model. Apply the changes and save the Data Stream.

Step 7: Results

Publish the Data Stream and let's look at the Live Data View. Observe the resulting events.

Files

File
Link
Security Key
Data Stream
Azure DT Action Agent.xuc
C0mp|ex123
Sample Data
Azure DT Action Agent.csv
DTDL Model
Pump.json
See the Import, Export, and Clone - XMPro article for steps to import a Data Stream.