Jumping over hurdles to get to insights using Azure

On the way to getting some data to an Azure DB, I explored strategy in using entity framework that was such a cool timesaver, I thought I’d share it for #GlobalAzureBootcamp

I could have done this years ago. It’s just that sometimes a task feels so complex, daunting or mind-numbingly boring that you make do with alternatives until you just have to bite the bullet.

We work in SMPP at Teleios. It’s one of the ways you can connect to mobile carriers and exchange messages.  From time to time, we need to analyze the SMPP traffic we’re sending/receiving and typically, we use WireShark for this. That’s as easy as setting it up to listen on a port and then filtering for the protocol we care about. Instead of actively monitoring with WireShark, we may at times use dumpcap to get chunks of files with network traffic for analysis later on.

What we found was that analyzing file by file was tedious, we wanted to analyze a collection of files at once. We’d known of cloud-based capture analysis solutions for a while, but they tended to focus on TCP and maybe HTTP. Our solution needed to be SMPP-based. So, we decided to build a rudimentary SMPP-based database to help with packet analysis.

That’s where the mind-numbingly boring work came in. In the SMPP 3.4 spec, a given SMPP PDU can contain 150 fields. The need for analysis en masse was so great that we had to construct that database. But this is where the ease of using modern tools jumped in.

I got a list of the SMPP fields from the WireShark site.  In the past, I would have then gone about crafting the SQL that represented those fields as columns in a table. But now, in the age of ORM, I made a class in C#. And if you’re following along from the top, I created a project in Visual Studio, turned on Entity Framework migrations and added a DataContext. From there, it was plain sailing, as I just needed to introduce my new class to my DataContext and push that migration to my db.

It probably took me 30 minutes to go from the list of 150 fields on WireShark to being able to  create the database without the necessary tables. Now, where does Azure come into all of this?

Each capture file we collect could contain thousands of messages. So, in my local development environment, when I first tried to ingest all those to my database, my progress bar told me I’d be waiting a few days.  With Azure, I rapidly provisioned a database and had it’s structure in place with this gem:

Database.Migrate();

That is, from the Entity Framework DataContext class, I called the Database.Migrate() method and any newly set up db would have my latest SMPP table. From there, I provisioned my first 400 DTU Azure SQL database and saw my progress bar for ingestion drop from days to hours.

With a database that size, queries over thousands of rows went by reasonably fast and gave us confidence that we’re on the right path.

We’re also working on a pipeline that automates ingestion of new capture files, very similar to what I did last year my Azure Container Instances project.

So, for #GlobalAzureBootcamp 2019, I’m glad that we were able to step over the hurdle of tedium into richer insights in our message processing.

Conquering complexity with a map

Last year, I worked with a researcher to develop a really cool, complex Azure solution to augment her work flow with some data. She needed to ingest a large volume of data, clean it up, run some AI on that and then present it. Typical data science activities that she wanted to run in the cloud.

I implemented the flow using several components including Azure Container Instances, Event Grid, Azure ML, Cosmos DB and Azure Functions. My daily drive at work doesn’t necessarily let me play in all those spaces at once, so I felt really glad to see all of those pieces work together.

Deploying took a bit more work as I wanted to make that as straightforward as possible. Thus, I used the Azure Fluent SDK that I was fanboying about across a few posts in 2018.

After everything was deployed though, I found visibility into the system was a bit of a stretch. My researcher colleague wanted to easily know where things were at in a given iteration of the process. I didn’t have a lot of solutions for that, so it was mostly email alerts.

That is, until I learnt about Azure Application map from two of my colleagues at Teleios – Ikechi, in Ops and Anand in Engineering.

It’s a part of Application Insights and lets you track dependencies between various services in an Azure solution. So, just out of the box, you can view the success of calls between web sites and web services and databases and other components. Going further, you can even add other components and dependencies to your app. That got me thinking. Maybe I can use Azure Application Map to display the various components of the solution and track issues in a visual, at-a-glance way?

I’m going to check it out.

Funky Azure Functions

Let’s talk about watering plants.

When I was younger, in my family, I was assigned the task of watering the flowering plants around the house. Thinking back on it now, there was easily 50 plants of all shapes and sizes. So, I would have to shuffle around the yard, bucket in hand, dipping and watering. Some plants would get two dips, others one. I couldn’t use the hose, because that might damage the roots of the younger plants. I hated it.

Ever the creative, I used to come up with outlandish ideas to solve the predicament. Sadly, I never implemented any of them. Thus, I was left to water these plants by hand.

Last week, for Caribbean Developer Week, I came up with a demo, featuring Azure Functions, that is the nearest to a solution to my plant watering needs back then that I have ever come.

I built three Azure Functions:

  1. Setup Waterer
  2. GuidEnqueuer
  3. Plant Waterer

Setup Waterer actually created more Azure Functions. Those would be Timer functions, each potentially able to run their own schedule.

GuidEnqueuer, alas poorly named, but good at pretending to be a plant food source, would receive an Http post and enqueue it. Plant Waterer would pick this up and display on a console. No actual plants benefited from this demo.

As I gushed previously, I created the Setup Waterer function on top of the Azure Fluent SDK and it worked fine. Functions making functions. That’s what I wanted to show really, and things worked well.

The code is available on my repo here.

Provisioning some test storage accounts for class

I wanted to create a few storage accounts for students in my class to complete an assignment featuring Event Sourcing and Material Views.

So, here’s what I did.

Download/install the latest azure command line interface (cli).
(While doing this, I realized I could have just used the cloud shell. I soldiered on with the dl)

Create a resource group to contain the accounts we’d need.

Create the accounts and output the storage account keys
The command to make a single storage account is pretty straightforward:

But I wanted to also output the keys and display them on a single line. The command to get the keys after the account is created is this:

So, I used the jq program in bash to parse the json result and display both keys on a line. Thus, I created a script that would create the accounts and then output their storage account keys.
This is the script that produced the accounts and keys:

Overall, the longest part of the exercise was dealing with the way the files were being saved in windows vs how they were being saved and read by bash. But the accounts were created and class can get on with assignment 2.

Exploring the differences between SaaS, PaaS and IaaS

In Cloud Technologies class today, we used both the course outline and the notes from MSFTImagine’s Github repo to talk through the differences in service offering.

I used the canonical service model responsibility chart to start the conversation off.

servicemodeldivisionofresponsibility
Service Model Division of Responsibility, via MSFTImagine on Github.

It’s fairly straightforward to talk to these divisions, of course. I often use it to drive home the NIST 2011 definition of cloud services. With emphasis on the service delivery models.

In today’s presentation, one of the things that jumped out at me was the slide that provided a distinction between SaaS Cloud Storage and IaaS.

distinctionbetweensaasandiaas
SaaS or IaaS, via MSFTImagine on Github.

Finally, when talking about the ever versatile Salesforce, and how its PaaS solution works out it reminded me of the Online Accommodation Student Information System (OASIS 🙂 ) that I had built when I was in undergrad.

I’d built OASIS as a commission for the Office of Student Advisory Services. It was a tool to help off-campus students more easily find accommodation. Prior to OASIS all the information was a notebook in an office. It was built before I learnt about the utility-based computing of cloud. I’m thinking about using that as the basis of an exploration of the architectural changes need to move an old service to the cloud.

Hopefully, I’ll be able to revisit it when we touch on Cloud Design Patterns.

Cloud Technologies – 2017. Ready, class 1

Started back with the UWI Cloud Technologies course today. This class was an Introduction to Cloud generally, with some conversation about the course outline and expectations for assignments.

We still in the process of confirming the course outline, so I’ll share that next week. But I used the slides from the technical resources provided by the Azure Computer Science module on cloud technology.

On my way to class I met up with Naresh who runs the UWI’s Department of Computing and Information Technology servers. He gave me a quick tour of their deployment. I’m looking forward to him sharing some stories from setting up that environment in our IaaS classes in a few weeks.

Recommended reading for today’s class is Consumption Economics: The New Rules of Tech

Presenting on Cloud Native

I presented on the imperative of designing specifically for the Cloud at the 13th edition of CaribNog.

My central treatise was that entities are moving away from simply Cloud-enabling existing solutions and having the Cloud as a backup. Analysts, architects and developers are strongly moving towards building solutions that are native to the Cloud.

Here’s the presentation.