Good morning!
C'mon, there's like 10 people in the front here.
Good Morning!
There we go, thank you.
Coming up on the show, we taking a look at how Azure Serverless offerings
allow you to build and deploy elastic scale cost efficient apps on Azure.
And we'll show you how adopting a serverless compute approach removes the need to worry about
hardware resources, and the operational complexity of running applications.
The event driven model for triggering compute power allows you to just pay for what you use.
And we'll walk through a serverless app for social analytics.
I'm joined by Jeff Holland from the Azure serverless team.
Good to have you Jeff.
Hey, great to be here.
Give it up for Jeff.
So serverless computing seems to have picked up a lot of momentum over the past year.
But, what is it and why has it come about?
Serverless is really in response to a number of stuff.
But mostly it's around removing all of the barriers that are traditionally there when building
and deploying software so that you can solve for business needs very quickly.
So traditional apps are designed to conform to the infrastructure that they are built on.
But serverless apps offer an app first model by abstracting away the infrastructure
to relieve the developer of the operational complexity of running those applications.
The infrastructure is only going to fire up when it needs to be.
So it's serverless, because you as a developer no longer have to worry about virtual machines,
patching, scaling, all those pieces that you are traditonally worrying about and managing.
And all of those things take time away from developing your solutions.
So with serverless, all you have to do is provide the code for your solution or define
that little bit of logic.
Publish it to the cloud and the rest is automatically taken care of for you.
So this means that you can build massive cloud skill applications in a fraction of the time.
Now what you just described to me sounds a lot like PasS.
How does this differ from platform as a service?
Sure, so with Platform as a service, you still need to choose your operating system and
dedicate some reserve capacity so you need to be able to forcast your demands.
And even then you're paying for that reserved capacity even if you're not fully utilizing it.
So how does this actually work in Azure?
In Azure, we have a series of resources allocated to you.
But their usage is triggered by some event.
So you give us your code, and whenever an event happens, could be when a message comes
in or an Azure alert.
Whatever you specify.
We spin up dynamically, the necessary compute resources and it's activity based billing.
So you're only paying for when you're using those resources.
So to help us all, can you give us an example and perhaps explain the architecture behind all of it?
Yes, so let's say that I have a website and people are uploading pictures
and I need to resize those images.
So whenever someone uploads a picture I want to automatically resize that.
So the upload of the picture in this case is the event.
This is where Azure functions come in.
It contains and runs that code.
And it has a series of bindings that will actually attach and listen to that event.
So in this case, whenever a picture gets uploaded, it will automatically trigger and resize the image.
Nice, so I'm a developer and I've got chunk of code, so I just give it to Azure functions
and it just executes?
That's it!
What if I need my code to do multiple tasks?
So If we stick with the photo example.
We might want to resize, compress and create a thumbnail
and perhaps upload it to some kind of store.
Yes, so each one of those tasks that you mentioned would be an Azure function.
And to orchestrate all of these different tasks, that's where I can use Azure Logic apps
to build a work flow.
So in your example, they could resize the image, compress the image, create a thumbnail,
upload it to some store.
All of that would be executed whenever I upload a picture.
And these tasks can be done to make sure that the next steps, let's say I want to upload to
a store like OneDrive.
What's great with Logic apps is most of the time I don't even have to write the code to integrate
with sources like OneDrive, because Azure Logic apps actually comes with a number of pre built connectors.
So developers just focus on their blocks of code and can utilize these connectors to integrate
with existing systems?
That's exactly right.
I'll show here on my screen that this is the gallery of connectors provided out of the
box with serverless apps.
There's over 180 connectors here today.
And these range from systems like on premises to SAP, Sales Force, Dyanamics, Office, Google docs, you name it.
So you can push and create data into any of these sources seamlessly.
The list is growing all the time?
Yes every time I open it, there is something new there.
Now alot of these connectors and what they connect to will be familiar to IT people.
So it's important that both IT and devs are working closely together to integrate these
connectors in a way that is best for the business.
Yeah that's exactly right, a lot of our IT department and IT departments we work with
find value in logic apps by making sure that the systems that they manage can be integrated
with the solutions that their developers are building.
So it sounds powerfull and very well and good.
But, can we see it in action?
Yes, so let's get straight to the demo then.
We are actually going to build a serverless app now.
And for this we are actually going to be able to build something pretty powerfull in just
a few minutes using serverless tech.
So here I have a Power BI dashboard that is totally empty.
And I want this thing to be populated with tweets in real time for all of the tweets
that are happening about Microsoft Ignite.
So I can be listening to any twitter topic that I want.
So let's go ahead and go through the tools that would be needed to build this solution
and trigger whenever anybody here posts a tweet on Ignite.
Analyze that tweet and publish it to this Power BI Dashboard.
Cool, let's do it.
I'm here back in the Azure portal.
This is Azure logic apps.
This serverless workflow, because I'm going to create the steps for my serverless app.
Now I already show you these connectors, but in this case we want to listen to tweets
coming from twitter.
So I can just choose that out of the box connector, and very easily, I haven't had to look into
any of the twitter APIs.
I'm already working and talking to Twitter directly.
I'm going to have this checked pretty frequently.
And listen to all tweets coming in right now on the official MSIgnite hashtag.
So next I'm going to add some steps.
What's going to happen next.
And the first thing I want to do is I'm going to use one of my favorite connectors
which is actually this text analytics connector.
Which uses machine learning as part of the cognitive services to automatically detect
the sentiment of some provided text.
So I'm going to add that step here and go ahead and pass in as this loads up.
The tweet text.
So within just a few clicks, I'm able to add in some machine learning into my serverless workflow.
There we go.
So let's go ahead and pass in that tweet text.
And just like that, now I'm going to have a score on the sentiment of the tweet from
the Ignite tweet.
Once you enable this, the tweets start to flow in.
And based on your search text, it's going to analyze whether it's a positive or a negative tweet.
Yeah, exactly right.
I've been able to do all of this so far in a few seconds and without any servers.
So let's keep building it out.
In here I want to bring in Azure functions because this sentiment step is going to give
me a score between zero and one.
But maybe I have some custom logic and I want to assign a color to that sentiment score
like red, yellow or green based on the tweet.
So that's a perfect bit of custom code that I can use Azure functions to solve.
So I'm going to say that I want to add an Azure function in my orchestration.
And you'll notice here have a library of all of the different functions in my subscription.
I Love Azure fuctions, so I have a bunch of them.
And here I have a function that I created ahead of time which will categorize the tweet.
Let me go ahead and pass in that score.
And I'll show you what this function looks like behind the scenes.
So this is an Azure function.
This is the only little bit of code that I need.
n this case the event that it's triggering from is that logic app step.
And I've written the code here that fires on that event.
So it's really easy and in this case the solution is totally scaled and hosted automatically for me.
I just provided this little bit of code.
And you can see it's some really simple logic here.
If this scores less than .3 then I mark it as red.
If it's less than .6 then it's yellow.
And everything else defaults to green.
And that's it!
So I've written that little bit of code and it's published to the cloud and it will run on demand.
So whats happening behind the scenes in Azure from a resource allocation and utilization perspective?
This is what's exciting is I provide this code and azure will automatically scale it for me.
So I'm going to switch over here, this is a function that's been running all morning
and it's a pretty heavy workload.
You'll notice here at the bottom, it has automatically scaled a number of different servers.
In fact there is about 200 servers here that are executing on these resources.
And what's great is that I didn't have to stand up these resources I just provided this code.
And it's triggered and scaled it dynamically to meet demand.
And I'm only paying for those resources that I'm using.
And because it auto scales as necessary, I don't have to worry about anything
infrastructure related at all?
Yeah exactly.
A huge workload just went off my plate.
That what we saw earlier was C-sharp?
Are other languages supported?
Yes, if I come in here to create a new function, You'll actually notice here that there is
a number of different languages reported from C-sharp, Java script, PowerShell, Python.
And this means that as a developer, you can choose whatever language works best for the problem.
And then you can develop, run and debug these Azure functions all within visual studio as well.
All my favorite languages there.
So can you now go ahead and visualize the data that we saw earlier?
So I still need to populate this Power BI dashboard.
So I'll come back over here to my serverless workflow.
And let's add in that last step here which is my Power BI connector.
Which will publish to a Power BI data set that is ready for us to go.
Now first and foremost here while I configure this, I want to call out that I've already
authenticated it against my own Power BI account.
Now we take security very seriously here, so what's actually happening is behind the
scenes we're using Azure key vault to securely encrypt and store your tokens.
Wherever possible we are using oauth so that we can just use that refresh token.
And if oauth is not supported for one of these connectors, we'll always use the means that
is most secure and encrypt that in Azure key vault for you.
And that's really important because we are connecting to data that is critical to running
your business and it's great to see that security is built into the platform.
And when you're connecting between multiple disparate data sources,
We want to make that as secure as possible for those to communicate with each other.
Okay, so what's next?
I've selected this data set.
And you'll see that the designers automatically detected the columns that are
available in this data set.
Again helping me do this very easily.
So now i'm just going to pass in the tweet text to Power BI who is making the tweet.
We want that sentiment score to know how happy people are to be here at Ignite.
That category is going to be the color from our Azure functions.
So red, yellow or green.
Let's see where they are tweeting from.
And let's go ahead and see when that tweet was created.
So I'm just going to go ahead and save this logic app.
We're done here.
Now this is listening to tweets in real time coming in from Ignite.
We are at a big event, Microsoft Ignite.
So you'll see in just a few seconds, this Power BI dashbaord is going to light up.
And this app is going to automatically scale to meet the needs
of all of these tweets coming in at real time.
Or for any of you who are tweeting right now with hashtag MSignite.
So while we are waiting for this to light up in a second, as it goes to pick up some tweets.
It says it's still listing the tweets.
Maybe not enough people are tweet about it.
But I'm going to go ahead and show you this other example of a workflow that I built out
ahead of time just to show you some of the capabilities that are possible there in your
serverless apps.
So you'll see this is the same start and it is still triggering on twitter.
Detecting a sentiment and running a function.
But in this case, I've also been able to add something like a condition.
So if someone does tweet something negative, I'm automatically posting an alert to a Microsoft
creating a support case in Dynamics 365.
So as a company, I'm able to start monitoring those tweets and
making sure there aren't unhappy customers.
That's awesome, so now that the app is deployed, how do we test and ensure that it's running
efficiently on an ongoing basis?
And you can see tweets are starting to come in.
Yeah, they are coming in now and a few people in redmond are tweeting about it.
This one is new, I'm going to go ahead and switch to a dashboard that I started earlier
this morning.
So this has been running for a while.
Same idea here, you see a bunch of tweets have come in since earlier today.
But, just showing you that this scale is automatically for us as these tweets are coming in
and this is being monitored.
You mentioned that this is running now, but how do I make sure that it is running reliably
and things are working?
This isn't like a traditional infrastructure where I can look at processor utilization
or other metrics in the same way.
Because everything comes to life on that event.
On that tweet.
So as you're building those apps, you're actually running the test to simulate the event triggers
and making sure that the app is going to work the way that you want it to as you're developing it.
But we do provide a number of tracing and monitoring out of the box.
So if I come to this Logic app that we built originally, you can see that it did run and fired.
And I can see all of the different runs that occurred.
And runs as they are happening.
What's great here too is that I actually get access to metrics and diagnostics
so I can have rich insights into what's happening.
And all of this integrates seamlessly with solutions like Log analytics or OMS.
So I've switched here and i'm showing OMS and how all my workflows are performing.
Before I show how app insights also works to see exactly what is happening inside my function code.
So I always know how my serverless app is performing.
With Azure serverless offerings you're getting a fully managed service that scales on demand,
you can build, deploy and run your apps in a fraction of the time.
But how do people get started?
So we have a number of quick starts across Azure functions and Azure logic apps.
So check out documentations page.
I'll switch to slide really quick so you can see it here.
But what's really exciting about serverless is that you can just spend an hour or two.
We just spent five minutes here and got something pretty exciting up and running.
So you can just spend an hour or two playing with Azure functions,
playing with Logic apps or event grid and have some really cool apps published
and in production in the Azure cloud.
So I'd encourage all of you here to go check it out and reach out to us on twitter if you have any questions.
We have a number of sessions here at Ignite
and recording for those sessions across serverless Azure functions, Azure logic apps.
So that all of you can get a feel for it and see exactly the productivity and power that
servlerss computing can bring to you.
Great stuff.
Thanks for joining us Jeff.
Don't forget to keep watching Microsoft Mechanics for the latest in tech updates.
See you next time.
Microsoft Mechanics