Create SAS Token from within an IoT Edge module

Description IoT Edge 1.2 brings a (currently in preview) MQTT broker, that can be used by local modules or external applications. A SAS token will be needed for authentication. If you want to use the broker from within an IoT Edge module, you can generate the SAS token by calling the workload API. The current SDK does not offer this functionality, as the MQTT broker is still in preview. The sample I’ve created uses the SecurityDaemonClient class from the event-grid-iot-edge SDK as reference and is written in C#.

Simulated Temperature IoT Edge Module

Me: Yeah! Another Simulated Temperature Sensor solution. You: Hold on. Why do you create another one again? Me: Well, mine is more flexible than the existing ones. You: OK. Show me Me: "SendData": true, "SendInterval": 500, "InstanceCount": 10 You: 🥺 Me: This module gives you the flexibility to have multiple sensors sending from one module. This can be configured by the InstanceCount. The existing solution allows you to set the send interval in seconds only.

docker-compose vs. CPU limit

That was a painfull learning today 🙁 Best is to blog about it now, so hopefully somebody reads this before (or during) troubleshooting a similar issue. What happened? My home server was running crazy and did not server any requests. Oh well, it decided to reply my ping but not really allowing a SSH session. So I needed to drag a TV downstairs to connect it via analog cable (fortunately I still found one), connect a keyboard and see that a process mono-sgen was eating all CPU 🙁 But what does it belong to?

Renew AWS SessionToken and store values in Azure KeyVault

Why do you need this? Using temporary session tokens sounds like a good way to e.g. import data from S3 in Azure Data Factory, like it is described here Copy data from Amazon Simple Storage Service (S3) – Azure Data Factory | Microsoft Docs. Azure Data Factory can use secrets stored in Azure KeyVault for authentication (see here Store credentials in Azure Key Vault – Azure Data Factory | Microsoft Docs).

Count provisioned devices by DPS

This post shows a way to find out how many IoT (Edge) devices have been provisioned by a specific enrolment group within the last x minutes. The solution could be much simpler if I just wanted to know how many devices are registering themselves. In this case the build in metrics are enough to get that information.IoT Hub Metrics The use case required a more sophisticated solution that is able to reflect the tenants, identified by tags.

Azure IoT Edge on constraint devices

In this post I would like to show some tweaks you can (and might need to) apply to influence the behavior of your IoT Edge device, when it comes to message retention on devices that are limited in resources. The setup of this scenario is not uncommon, as it uses a module to retrieve telemetry from machines, parses them in another module and sends the messages to an IoT Hub.

Azure IoT Edge not starting

Sometimes a permission denied is a permission denied 🙁 [INFO] - Starting Azure IoT Edge Security Daemon<br>[INFO] - Version - 1.0.10~rc1<br>[INFO] - Using config file: /etc/iotedge/config.yaml<br>[INFO] - Configuring /var/lib/iotedge as the home directory.<br>[INFO] - Configuring certificates…<br>[INFO] - Transparent gateway certificates not found, operating in quick start mode…<br>[INFO] - Finished configuring provisioning environment variables and certificates.<br>[INFO] - Initializing hsm…<br>[INFO] - Finished initializing hsm.<br>[INFO] - Provisioning edge device…<br>[INFO] - Starting provisioning edge device via manual mode using a device connection string…<br>[INFO] - Manually provisioning device "iotedgedevice" in hub "iothub.

Properties for IoT Messages in Azure Stream Analytics

In this post I want to show how to use properties that are added to messages that IoT devices are sending to Azure IoT Hub in Stream Analytics. And while talking about properties, let’s even use message enrichment 🙂Stream Analytics Architecture Sample Message The green properties will be added by the Message enrichment feature of IoT Hub, as the data is not most likely not known on the IoT device or does not need to be transferred with each message.

IoT-Edge-HddMonitoring

With Azure IoT Edge you can deploy modules (also known as Docker Containers) to a server. I’ve created a sample solution on GitHub that deploys a module which monitors the temperature of the harddisk that the server is running on. https://github.com/ReneHezser/IoT-Edge-HddMonitoring The repository can be a starting point for further customization.

VisionAI DevKit won’t deploy a module

Today my VisionAI DevKit was not deploying a module. In the logs (sudo journalctl -u iotedge -f) I could see the deployment was received: Successfully pulled image machinelearndfd8df7d.azurecr.io/mobilenetimagenet:3<br>Creating module VisionSampleImagenet…<br>Could not create module VisionSampleImagenet<br>caused by: No such image: machinelearndfd8df7d.azurecr.io/mobilenetimagenet:3 Strange. During troubleshooting I started docker images and saw a lot of older images and versions. After deleting a log of them with docker image rm xyz the deployment succeeded and the module started.

Configure Azure IoT Edge for downstream devices

A lot of documentation and posts are available to setup an Azure IoT Edge to act as an IoT Hub for downstream devices. In order to get it up and running in a dev environment, I had to do some more research. My setup is a RaspberryPi 3 with Raspbian stretch and an Azure IoT DevKit which looks like this. And please remember the setup I used is for development only.

Azure SQL with AAD authentication

I though this had to be an easy task. Well, actually it is. If you find the right documentation and read it in the correct order 🙂 Basically I wanted to be able to login with my AAD (Azure Active Directory) user. In the first step, the database needs to be configured for Azure Active Directory in order to add users in the second step. Configure an Administrator In the Azure portal go the the SQL server and search for “active directory” to add an Active Directory admin.

Two Hackathons in a week

What a week. Two hackathons (‘hack’+marathon) in a row. That was exhausting. A three day hackathon with my colleges from Arvato Systems and a customer. We’ve used Cognitive services with 8 different programming languages and created great PoCs.         The second hackathon was about Azure Stack with Microsoft. Thanks to all participants, the organisation. It has been fun and a great experience.

Azure Meetup OWL

Es ist wieder soweit. Am 18.7. um 18h treffen wir uns wieder. Die Themen: Azure Stack – René Hézser Terraform – Tyler Ayers Auch dieses Mal sind wir wieder zu Gast bei Arvato Systems. D.h. dass ich eine namentliche Anmeldung benötige. Deshalb meldet euch bitte über unser Meetup (https://www.meetup.com/Azure-Meetup-OWL/events/251641785/) oder per E-Mail an.  

Softwareentwicklung in der Cloud. Was ändert sich?

Vielen Unternehmen ist der Start in die Cloud bereits geglückt – oder es wird intensiv daran gearbeitet. Spätestens jetzt wird klar: Die Cloud ändert so einiges. Ein guter Zeitpunkt also, um darüber nachzudenken, wie wir mit Cloud-Technologien eigentlich umgehen wollen. Den Artikel habe ich auf dem Arvato Systems Cloud-Blog veröffentlicht.