How to roll your own rss2twitter bot in 15 minutes in Azure?

Introduction

For today I’ll show you how to roll your own rss2twitter bot in about 15 minutes. What will this bot do?

  • Check an RSS feed for new entries
  • Parse the new entry and replace key words with hashtags
  • Post it to twitter

For this we’ll be using ;

  • Azure Function : as the customer code to find/replace certain words
  • Logic App : as the tool to create our process via a visual tool

And in the end, we’ll see something like this ;

2017-02-08-19_15_28-azure-inspired-azureinspired-_-twitter

Continue reading “How to roll your own rss2twitter bot in 15 minutes in Azure?”

Changing the timezone on your Azure Webapp / App Service / Function

 

Issue

With one of my flows, I was using an Azure function to generate a filename for my Azure logic app. This name was generated based on the date…

2017-01-24-20_10_33-application-settings-microsoft-azure

What did I see happening…2017-01-24-20_11_20-scoreboard-microsoft-azure

As I the script ran just after midnight, I saw that I was getting the day before instead of the actual date.

Continue reading “Changing the timezone on your Azure Webapp / App Service / Function”

Azure : Mixing LogicApps & Functions as a periodic data retriever

Introduction

There are various articles/blogs/etc that compare logicapps vs flow vs functions vs azure automation, etc… Though there was one use case where I often struggled what to use ;

What to use when I want to retrieve a file from X on a Y timed interval?

Azure Functions? Great abstraction, though the output files have random names. Sometimes / Often I want to be able to control that.

Flow? Doesn’t allow the customization I was looking for. More to integrate existing / popular services.

Azure Automation? Very good and gets the job done. The only downside, you need to code a lot of logic yourself.

Azure Logic Apps? Shows potential, but doesn’t let you include custom functions. Or does it…?!?

You can link Azure Functions to Logic Apps and create some the flow I was looking for.

 

The Flow

So what do I want to do?

  • On a daily basis
  • Retrieve content from an authenticated API
  • Save the content to a Blob storage

And afterwards I’ll use other services to process that data. 🙂

 

The Proof-of-Concept

What do I want to achieve? On a daily basis I want to retrieve data from a service provider that serves sports data. And if you are looking for such a thing, check out MySportsFeed! So back to our proof-of-concept; how will this look in Logic Apps?

2017-01-20-21_10_27-inputs-microsoft-azure

Let’s dissect this flow…

Continue reading “Azure : Mixing LogicApps & Functions as a periodic data retriever”

Azure IoT : From RaspberryPi with Sensor to Azure Storage Table by using a serverless architecture

Introduction

A few days ago my connectors arrived for my latest PoC on Azure. So today I’m writing about my experience in using a RaspberryPi with a temperature & humidity sensor and to save the telemetry data in Azure. For this we’ll be using Azure Event Hub as an ingress mechanism, and Azure Functions to storage the events towards an Azure Storage Account. My next venture will be to use this data to create reports and maybe (on the long run) do some machine learning. For the latter, I’m pondering about linking this system to my ebus system of my heating system. That way I could correlate the data from the various censors (RPi, Thermostat & outside sensor) in combination with the heater information & heating schedules. Basically… creating my own  Google Nest. 🙂

 

Sensor : Physical Connection (I2C)

The guys from ThingTank had a spare sensor lying around, which they lend to me for my PoC… This was a “Grove – Temperature&Humidity Sensor (High-Accuracy & Mini)“. As you can see in the picture, underneath, this one has an I2C connector. We see four connections ; GND, VCC, SDA & SCL.

grove-tem-hum-accuracy-mini_01

Continue reading “Azure IoT : From RaspberryPi with Sensor to Azure Storage Table by using a serverless architecture”

Azure Functions : A quick demo when using Event Hub

Introduction

Azure functions is the “serverless” offering on Azure. Serverless doesn’t mean there aren’t any servers, but it’s rather a platform service where you can run your own snippets of code. Each code can be triggered, where it then can have an in and/or output. In terms of billing, you pay for the amount of runtime you consume.

Imagine having a stateless web front end which publishes state onto a queue or storage account. Then Azure functions is being triggered and your business logic starts. Sounds familiar? Yes, because that’s a typical flow you normally do in your application stacks. Now you can segment that even more into services you do not need to manage.

 

Demo

Today I’m going to show you a very brief demo on using an Azure Event Hub as trigger/input for an Azure function. So what’s the flow we’ll be doing?

  • A client will put a message on the event hub queue
  • This will trigger an Azure function
  • The function will save the contents of the message onto a storage account

Sound simple right? And it actually is that simple to do too!

 

Continue reading “Azure Functions : A quick demo when using Event Hub”