Migrating existing IoT Edge modules to the 0.2.0 template scaffolding

Just today I found out a new version of the Azure IoT Edge extension for VSCode is available. Amongst other changes like new commands, Microsoft also introduced a new folder structure and new files.

Microsoft also introduced a migration wizard for old modules.

This was a bit of a confusion. My first thoughts were that Microsoft offered migration from the old 1.1 modules (based on classes) to the new (Docker-based) modules.

But this migration is offered for previous built C# modules and IoT Edge Azure functions. Microsoft offers some documentation but let’s look at this migration in detail.

I have built and blogged about a C# Heartbeat module. Let’s migrate it.

Continue reading “Migrating existing IoT Edge modules to the 0.2.0 template scaffolding”

Advertenties

GABC – Atos Amstelveen zaterdag 21 april 2018

“Intelligent Cloud, Intelligent Edge”

logo-2018-500x444

Voor het derde jaar op rij organiseert Atos de gratis Global Azure Bootcamp op haar hoofdkantoor te Amstelveen.

Aanmelden doe je hier!

Traditioneel ligt bij ons de focus op IoT en dus passeren alle mogelijkheden die Microsoft Azure op dit vlak biedt. Er worden naast presentaties ook verschillende workshops gegeven. En natuurlijk is er voldoende tijd om ook met onze Azure IoT platform experts van gedachten te wisselen. Of je nu vragen hebt over Domotica, Lora, Windows 10 IoT Core of industriële IoT, we gaan samen op zoek naar het antwoord.

De agenda voor de dag ziet er als volgt uit:

9.30 Inloop + ontvangst

10.00 Opening

12.00 Lunch

15.30 Tombola + Afsluiting met een hapje en drankje

Tussendoor zijn er meerdere labs, workshops en natuurlijk presentaties over IoT.

Nieuw is de door ons ontwikkelde workshop waarbij jouw laptop in een Edge gateway verandert. Hierbij krijgt je de opdracht om op eenvoudige wijze data uit een industrieel Modbus protocol naar de Cloud te brengen.

En we hebben wederom de workshop rond Lora en Azure op het programma staan.

Neem je laptop dus zeker mee. Voor de labs en workshops is een installatie van Visual Studio 2017 of Visual Code nodig en een Azure Account. Wie nog geen Azure account heeft krijgt zonder verdere verplichtingen de beschikking over een trial licentie.

Ons adres is:

Atos Nederland

Burgemeester Rijnderslaan 30

1185 MC Amstelveen

https://atos.net/nl/nederland

Route

(Gasten dienen zich op ons hoofdkantoor te kunnen legitimeren. Neem dus een geldig legitimatiebewijs mee.)

Take back control over IoTHub messages in Azure Functions

Azure Functions are a blessing for IoT solutions. To be so flexible executing code whenever messages are arriving, every IoT project is fully depending on it.

But one of the biggest frustrations is the casting of (EventHub) messages towards a string! Only the message body is left! Once a message is passed on to an Azure Function, I only have access to the body of the message. I can not access the (routing) properties anymore.

And before we got Azure Functions, we had to work with Stream Analytics. And I still do! And it’s so nice to have access to the IoT Hub values like the device name of the message. Because I am working with Azure Functions, I have to put it in the Message body first???

It would be great to have access to both the properties and the IoTHub values!

Well, it’s possible now with some clever casting…

Continue reading “Take back control over IoTHub messages in Azure Functions”

Writing commands to IoT Edge Modbus Modules

Microsoft provides several out-of-the-box modules for their Azure IoT Edge platform. If we do a quick search at the Public Docker repository, we see modules like

  • microsoft/iot-edge-opc-publisher
  • microsoft/iot-edge-opc-proxy
  • microsoft/azureiotedge-modbus-tcp
  • etc,

I already have described in a previous blog, how to consume and read data from that Modbus module. After checking out the documentation and some testing, I found out how to write commands back to the device too.

Let’s check out how we can use this in a Custom C# module. After that, we use it in an Azure Functions Module. So let’s do a deeper dive into Azure Functions on the IoT Edge as well.

Continue reading “Writing commands to IoT Edge Modbus Modules”

Part 3: Adding Basic Authentication to Asp.Net Core the right way

This blog is all about adding Basic Authentication to Asp.Net Core.

Warning: Although implementing Basic Authentication seems easy, it brings a vulnerability to your site! names and passwords provided are sent over the internet unencrypted. This means: the authentication method does not hide the name and password for hackers. You have to encrypt the communication yourself! Therefore, always combine Basic Authentication with SSL, also known as HTTPS.

In the past, I have written my own simple Basic Authentication NuGet package. It’s still ok for simple classic Asp.Net MVC projects.

But I want to use Basic Authentication In Asp.Net Core. Instead of (re)writing my own NuGet package, I checked out the NuGet store and found a nice solution.

This NuGet package provides me the flexibility to add Basic Authentication to my (test) projects.

In this blog, we will see what we have to do to get it running. And we will see how we can beef up the security by using HTTPS.

Continue reading “Part 3: Adding Basic Authentication to Asp.Net Core the right way”

Part 2: Passing data from outside an Asp.Net MVC Core site to the browser using SignalR

In my last blog, I show how you can implement SignalR on a website running Asp.Net MVC Core. Although the libraries are still in Alpha, the functionality looks very promising.

In this blog, I will show you how you can pass data on to the website so it can be shown in the browser. Users will ‘instantly’ see updates coming on the website.

Let’s check this out.

Continue reading “Part 2: Passing data from outside an Asp.Net MVC Core site to the browser using SignalR”

Part 1: Getting SignalR running on Asp.Net MVC Core

Microsoft has a very powerful implementation of WebSockets available named SignalR. Personally, I like the fact it automatically scales down if needed to other communication solutions if WebSockets is not working (like long polling).

I used it in the past several times for dashboards but in my current project, I had a new challenge. We are using Asp.Net MVC Core. This is ‘the latest’ flavor of Asp.Net and our websites can now run on both Windows and Linux.

But Asp.Net MVC Core has broken with the past, which is a good thing but it also needs a different way to activate SignalR.

Microsoft has provided documentation but it was written towards the standard, non-MVC applications.

It took me a while to get SignalR running.

But first, let me introduce you to the steps to be taken to get SignalR running on Asp.Net MVC Core. Continue reading “Part 1: Getting SignalR running on Asp.Net MVC Core”