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”

Advertenties

Migrating Azure Functions from portal to Visual Studio

Azure Functions are a great addition to the whole family of Azure resources. Azure Functions are my number one workhorses. The fact that I can execute code, triggered by ‘whatever’, gives me so much power for a fraction of the costs.

And the beauty of it is, you can write those nifty pieces of code directly into the Azure portal using nothing more than a browser.

But as always, with great power comes great responsibilities!

The code I write in the portal is not supporting any version control. And I cannot debug this code.

Although I am up-and-running with Azure Functions in a few hours, I want to debug and put my code in version control too!

Luckily, I can create Azure Function in Visual Studio too. And this gives me the power of debugging and version control. But what are the drawbacks?

Let’s explore om how to migrate your Azure Function, written in the portal, into Visual Studio.

Continue reading “Migrating Azure Functions from portal to Visual Studio”

Using an External Table output in Azure Functions

As seen in my previous blog, I am experimenting with passing data to a SqlAzure table using Azure Functions.

I first used the new and apparently experimental External Table output available in Azure Functions. Experimental just means in preview.

Due to throttling issues, I had to abandon it where I wanted to insert multiple (+200) records.

But this Azure Functions output is a very promising way to insert records in all kinds of data sources. I can recommend using it when you want to insert, alter or lookup data.

Let’s take a closer look.

Continue reading “Using an External Table output in Azure Functions”

Passing JSON arrays to SqlAzure from Azure Functions using OPENJSON

During my last project, we had to pass arrays of data to SqlAzure.

Normally, passing data is not that interesting. But we were passing data in bulk to SqlAzure so there is always a chance of throttling.

This is when you pass correct records towards SqlAzure but you reach certain limitations eg. if you hit the DTU limits.

We were getting a few hundred records which we first inserted one by one (using the ExternalTable (experimental) output). But we only we able to insert approx. forty records.

So we switched back to a stored procedure.

The second challenge was how to pass an array of records. Because we got the data as JSON, we wanted to pass an array of records like JSON.

In the example below, I show how to call a stored procedure within an Azure Function. The code could be simplified if not I wanted to do some transformations.

Continue reading “Passing JSON arrays to SqlAzure from Azure Functions using OPENJSON”

Combining Azure StreamAnalytics with Azure Function Sink

There are many ways to collect data from an IoTHub and pass it through Azure Functions:

  • Trigger an Azure Function directly by the IoTHub events or operations monitoring
  • Trigger an Azure Function using an EventHub or message bus as endpoints of IoTHub routing
  • Trigger an Azure Function using an EventHub as output sink of a Stream Analytics job

All these solutions serve their own purpose.

But the last one, using an EventHub, can be pretty annoying. Yes, this is a great way if you will use the security policies and/or consumer groups of the Eventhub. But otherwise, there is a lot of administration.

Let’s check out how life is becoming much easier with a new Azure functionality which is still in public preview called Azure Function Sink.

Continue reading “Combining Azure StreamAnalytics with Azure Function Sink”

Azure Functions as watchdog for missing telemetry or devices

Once you are working with the Azure IoT platform, there comes a moment where you want to add notifications.

In a previous blog, we looked at how to send notifications when telemetry values did not match certain ranges. Although this is great, there are even more cases where we want notifications.

Here I am referring to watchdog functionality. When no telemetry is arriving anymore or devices are disconnected, the complete IoT platform is not working as designed. So we want to be informed when something fails.

In this blog, we will build a simple watchdog using Azure Functions.

Continue reading “Azure Functions as watchdog for missing telemetry or devices”

The only thing standing between IoT Hub and Functions are Consumers groups

Traditionally, when telemetry arrived at an Azure IoT Hub, it was a rule of thumb to pass it to a Stream Analytics job. But when routing was introduced in the IoT Hub, it became possible to push the telemetry directly into an EventHub or a Service Bus too.

I still favor the many possibilities of the Stream Analytics job, working with temporal and geospatial data eg. is so much easier that way.

But I can configure a lot of other, new Azure resources after the Event Hub or the Service Bus.

For example, IoT Hub routing to an Event Hub makes it possible to pass telemetry to Azure Functions (using the EventHubTrigger). This opens a whole new world of Azure opportunities using only an EventHub in this case! But it can be done even simpler…

Continue reading “The only thing standing between IoT Hub and Functions are Consumers groups”