Now that we have the IoT hub set up, we can create the Edge Device for the IoT Hub.
We will then deploy a VM as a simulated IoT Edge Runtime and deploy the Edge Runtime Modules which provide the simulation data.
We start with creating the Edge Device in the IoT Hub. In the just deployed resources from the previous step of installing the DSK IoT Bridge you should find the IoT Hub resource. Open this resource in the Azure Portal.
As shown in the screenshow below, next, navigate through the side menu to "IoT Edge". In the overview click on "Add an IoT Edge device".
Give your device a name and click "Save". Your device will be created.
When the device is created, open the device details by clicking it. Leave this tab open, we will need the primary connetion string in just a second.
We will now deploy a Linux Ubuntu virtual machine with a simulated IoT Edge Runtime and connect it as our IoT edge device.
Please choose a expressive unique name for the agent and its related resources. The Size
Standard_B1s should be fine for the purpose of this guide. If you are planning on processing large amounts of data consider using a more powerful instance (e.g.
Standard_DS1_v2). For more details see Sizes for virtual machines in Azure
Configure and enable SSH access so that you can log into the VM after it has been created, e.g. through setting a password.
Create the VM by following the "Review + create" steps.
If the VM has been created with password based SSH access you can log into the VM with a terminal of your choice by running the following commands.
If you later want to configure the agent with the Agent-Companion you can use SSH port-forwarding to enable remote connections to the agent by supplying additional paramateres at the command.
ssh <username>@<your-vm-ip-address> -L <local-port>:localhost:5000 (agent available at
ssh email@example.com -L 5000:localhost:5000 (agent available at
Note that you can find the ip-address of your vm by navigating to the created VM in the Azure portal.
You will need two Azure Edge Runtime modules. A simulated source of sensor values and the DSK Agent Edge. The job of the data-source is to create simulated values. The Agent is responsible for signing the data and sending the data as well as the signatures (proofs) to the DSK Node.
The Simulated Temperature Sensor is provided by Azure IoT and can be found in the Marketplace.
Create a new Simulated Temperature Sensor by clicking "Create" in the Azure Marketplace listing:
Select your IoT Hub and Edge Device as Target devices for the module and click "Create":
After the Simulated Temperature Sensor Module has been created, click on the new module to open its settings:
In the settings, in the tab "Environment Variables", set up the variable "MessageCount" and give it a value of -1. This will allow for an infinite number of sensor readings. After that click on "Update":
Finalize the setup of the Simulated Temperature Sensor Module by following the "Review + create" steps:
The DSK Agent Edge can also be found in the Marketplace.
Proceed the same way as previously for the Simulated Temperature Sensor Module: Click "Create" in the Azure Marketplace listing and select your IoT Hub and the Edge device and click "Create", shown in the screenshots below.
Some environment variables must be configured for the agent.
To be able to create signatures, the Agent needs to be connected to the Trust-API of the DSK Node which requires API-Credentials. The credentials for the Trust-API can be obtained the same way as the credentials for the Data-API have been obtained when installing the DSK IoT Bridge.
Open the module by clicking it in the list of IoT Edge Modules and navigate to the tab "Environment Variables". There you will have a number of variables, which are explained below the screenshot.
|EdgeDeviceOptions__AgentID||Choose a unique string -> you can easily generate a GUID online|
|ProofSinkOptions__TrustAPIBaseUrl||Trust API Url. Replace |
|ProofSinkOptions__AuthUrl||Auth Url from Trust API Swagger UI authorization dialog. You can simply replace |
|ProofSinkOptions__AuthScope||Auth Scope from Trust API Swagger UI authorization dialog. The sample value should work for most cases.|
|ProofSinkOptions__ClientID||Client ID from the DataSpace Admin|
|ProofSinkOptions__ClientSecret||Client Secret from the DataSpace Admin|
As for the last variable, the EdgeDeviceOptions__DataStreamID__[DataStreamID], you will have to set up 4 variables for it:
Note that you can easily copy the DataStreamID by clicking the copy button in the column ID as explained in the step Create a Dataset.
Finally, double check your variables and click "Update". Then follow the "Review + Create" process.
All that's left now is the configuration of the routes, so that the simulated data actually ends up where it should.
First, open the IoT Hub in the Azure portal and select the device:
Then, click on "Set Modules" and navigate to the routes by clicking "Next: Routes":
Lastly, set the following two routes:
|SimulatedSensorToDSKAgent||FROM /messages/modules/SimulatedTemperatureSensor/outputs/temperatureOutput INTO BrokeredEndpoint("/modules/TributechDataSpaceAgent/inputs/AzureSimulatedSensorValue")|
|DSKEdgeAgentValuesToCloud||FROM /messages/modules/TributechDataSpaceAgent/outputs/ValueSink INTO $upstream|
Two routes are required, one for sending the simulated sensor data to the DSK Agent and one for transmission of the DSK Agent Edge to the IoT Hub.
Finish the process by clicking "Review + create" and following the process.
You can verify that everything works as expected by checking the Overview dashboard of your IoT Hub in the Azure Portal:
You can also already create your first dashboard and have the simulated data presented visually. Just follow the guide for consuming data via Dashboards. Note that for this case you would be in the position of data owner.