Recently we released IoT Edge v2 Public Preview coming with a bunch of enhancements and new functionality. The runtime is now completely .NET core based and containerized. That in place you’re now able to write and consume models as docker containers. Deployment, Testing, Configuration everything docker offers can be used now in IoT Edge.
Beside the fact that you can customize the Edge Device with custom modules you’re also able to provision certain Azure services to the edge device itself. Services available in IoT Edge are Azure Stream Analytics, Azure Machine Learning and the Azure Functions runtime, allowing you to integrate Azure Functions based execution on the edge device. You can leverage the power Azure offers you on premise in your edge environment deployed through containers.
To inject business rules into your Internet of Things environment you can write custom modules including the logic you need to manipulate and analyze the collected data in the edge even before submitting it to the IoT Hub. You can connect multiple modules through messaging or direct communication to fulfil the needs of the business.
We provide tutorials to get started with the development for IoT Edge. The current development experience is targeting dotnet core developers but others will follow.
If you are a dotnet core developer you can enhance the dotnet core cli experience through custom IoT Edge templates
The templates provide you a good starting point in creating a skeleton project for a custom module. To create one you simply
dotnet new aziotedgemodule -n mymodule. Once the project is scaffolded you leverage
Microsoft.Azure.Devices.Client to access the IoT Edge runtime from your module to access the message endpoints or device twin properties. This also included the module twin properties.
The following sample is showing how to inject during initialization custom code to emit test data to a message endpoint
SendEventAsync is sending the message into the message endpoint of the IoT Edge Device called
PointOutput. With a route definition to
$upstream - which is the special endpoint to send data to the IoT Hub - generated data can be monitored in the IoT Hub.
If you want to have a full fledged data emitting module you can take a look at this repository https://github.com/dariuszparys/iotedge-simulator-module.
IoT Edge allows you to control and work with your data before it goes up to the cloud. You can even just leave it on premise if you want. With custom modules you have all flexibility to define the logic the way you need it for your devices, completely manageable from the cloud. Device and module definitions can be pushed to the corresponding locations and change behavior during runtime. Further with the cloud intelligence on your edge you can leverage the power of Stream Analytics and Machine Learning in the edge environment being able to support even offline scenarios.