We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

Deploy Python to the cloud faster with Azure Serverless

00:00

Formal Metadata

Title
Deploy Python to the cloud faster with Azure Serverless
Title of Series
Number of Parts
118
Author
License
CC Attribution - NonCommercial - ShareAlike 3.0 Unported:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal and non-commercial purpose as long as the work is attributed to the author in the manner specified by the author or licensor and the work or content is shared also in adapted form only under the conditions of this
Identifiers
Publisher
Release Date
Language

Content Metadata

Subject Area
Genre
Abstract
Bringing your Python scripts or apps and running them in the cloud is easier than ever with serverless computing. In this talk, we’ll show how you can use Azure Functions to easily deploy and scale your Python workloads without having to manage any servers or pay for unused compute resources. We’ll also show how deep integration with Visual Studio Code offers a great local development experience with full support for debugging and testing your app, and allows you to seamlessly deploy your serverless code to the cloud. We’ll start by giving a brief overview of the value of serverless computing. Next, we'll create a brand new Python app in Visual Studio Code, and start to add in business logic and ML capabilities. Once we get the app running debugged locally, we’ll publish it to the cloud as a serverless function, and demonstrate the serverless scalability. Finally, we’ll walk you through the tools and capabilities you can leverage around monitoring and management of your Python Azure Functions.
Keywords
20
58
Point cloudGoogolQuicksortService (economics)Computer programmingData managementComputer animation
Functional (mathematics)Form (programming)Function (mathematics)Lambda calculusServer (computing)Electronic mailing listContext awarenessVaporAnalogyLecture/Conference
Sanitary sewerFormal languageComputer configurationFunction (mathematics)Machine codeDisintegrationCommon Language InfrastructureSource codeScale (map)Real numberMachine codeData managementDirection (geometry)Virtual machineSlide ruleFunctional (mathematics)Structural loadDevice driverMachine codeComputing platformConstraint (mathematics)Visualization (computer graphics)Formal languageDifferent (Kate Ryan album)Pivot elementSource codeService (economics)Point cloudCartesian coordinate systemTransportation theory (mathematics)Multiplication signDecision theoryBitFunction (mathematics)Information securityPoint (geometry)Cloud computingLocal ringServer (computing)Virtueller ServerClosed setComputer hardwareComputer configurationEvent horizonText editorNumberPurchasingSoftware developerSocial classPhysical systemBit rateKey (cryptography)Scripting languageINTEGRALJava appletOpen sourceMobile appScaling (geometry)Shared memoryOperating systemChannel capacityElectronic mailing listRun time (program lifecycle phase)Feasibility studyBlogPower (physics)Computer animation
BuildingDemo (music)Function (mathematics)Machine codeVisual systemExtension (kinesiology)Event horizonData storage deviceFunctional (mathematics)Function (mathematics)Service (economics)Visualization (computer graphics)Computer configurationExtension (kinesiology)Parameter (computer programming)Machine codeFormal languageVirtual machineMachine codeProjective planeComputer iconQuery languageMultiplication signText editorRun time (program lifecycle phase)CASE <Informatik>Right angleMessage passingString (computer science)Polarization (waves)Source codePoint cloudMedical imagingType theoryWindow functionCartesian coordinate systemDifferent (Kate Ryan album)Open sourceMathematicsTemplate (C++)Video gamePoint (geometry)Control flowData storage deviceEvent horizonMetadataScripting languageSoftware testingP (complexity)Category of beingMathematical analysisVideo game consoleAuthenticationClient (computing)NumberQueue (abstract data type)DatabaseDependent and independent variablesComputer fileSoftware bugAudiovisualisierungSystem callUniform resource locatorSource code
Parallel portMagneto-optical driveDirectory serviceFunction (mathematics)Visualization (computer graphics)Function (mathematics)Directory serviceBuildingMobile appBitWindow functionMultiplication signEndliche ModelltheorieServer (computing)Complex (psychology)Different (Kate Ryan album)Right angleFunctional (mathematics)MereologyCASE <Informatik>Projective planeConnected spaceOrder (biology)InternetworkingPoint cloudComputer fileData modelUniform resource locatorType theoryLine (geometry)Message passingMachine codeProduct (business)Control flowFile archiverScripting languagePattern languageSoftware developerMathematicsIntegrated development environmentPoint (geometry)Machine codeFlagLocal ringData Encryption StandardDemo (music)Revision controlWeightWebsiteLibrary (computing)Scaling (geometry)Virtual machine
Power (physics)Mobile appLogicSuspension (chemistry)Revision controlMereologyRight angleDampingLogicTwitterMultiplication signDynamical systemBitFunction (mathematics)Machine codeScaling (geometry)Product (business)Power (physics)Service (economics)CASE <Informatik>CircleUniform resource locatorMobile appServer (computing)Video gameElectronic mailing listNegative numberPosition operatorGraph coloring2 (number)Cartesian coordinate systemGreen's functionFunctional (mathematics)Inheritance (object-oriented programming)Different (Kate Ryan album)GoogolCuboidComputer animation
2 (number)Scaling (geometry)Function (mathematics)Line (geometry)Server (computing)Set (mathematics)Event horizonMachine codeConfiguration spaceFunctional (mathematics)Lecture/ConferenceSource code
Function (mathematics)VideoconferencingMachine codeSample (statistics)Power (physics)Sampling (statistics)Machine codeFunction (mathematics)VideoconferencingWebsiteFunctional (mathematics)Mobile appDifferent (Kate Ryan album)WeightText editorLibrary (computing)Coma BerenicesLink (knot theory)Computer animation
Function (mathematics)VideoconferencingMachine codeSample (statistics)Functional (mathematics)Machine codeSampling (statistics)Software developerVisualization (computer graphics)Machine codeService (economics)Function (mathematics)Internet der Dinge
Functional (mathematics)LaptopMachine codeFunction (mathematics)Electronic mailing listOpen setServer (computing)Cartesian coordinate systemLecture/Conference
Multiplication signNumberFunction (mathematics)Mobile appProduct (business)Meeting/Interview
Projective planeMathematicsFunctional (mathematics)Computer fileValidity (statistics)Open sourceFunction (mathematics)Damping
Function (mathematics)Scaling (geometry)Medical imagingComputer fileMultiplication signProjective planeIntegrated development environmentCombinatory logicDemo (music)Right angleEvent-driven programmingMereologyElectronic mailing listService (economics)Shift operatorPoint cloudServer (computing)Event horizon
Function (mathematics)Scaling (geometry)Virtual machinePlanningMultiplication signPay televisionEndliche ModelltheorieDefault (computer science)Computer configurationInheritance (object-oriented programming)BitElectronic mailing listServer (computing)FeedbackSpeech synthesisLimit (category theory)Figurate numberLecture/ConferenceMeeting/Interview
Transcript: English(auto-generated)
All right, welcome everyone. We have 30 minutes. There's a bunch that I want to cover today. So first off, as was mentioned, I'm Jeff Holland. I am a program manager. I work in the engineering team out of Seattle. So I was very excited for the chance to travel out here with a few members
from our team as well and talk to you today about Python and specifically with Azure Serverless. Now before we start, just to get a feel for the room, how many of you here have already used Serverless in some form or fashion? That's AWS Lambda, Azure Functions, Google Cloud Functions. Okay, great, so about 20%. And then of those, how many have used
Azure Functions specifically? Okay, on very few. Great, so everyone will learn something today. Let's get started then. So for those who maybe didn't raise their hand, before I even start, I want to set some context. Like what is Serverless? What is with all of the people talking about Serverless?
How much is Hype? How much is just Vapor? And to kind of explain how I think about Serverless, I wanted to use this analogy. And that's how did I get here today or how did any of you get here today? And specifically this one, the public transportation in Switzerland's a little bit better than when I give this talk elsewhere in maybe the United States.
But for me, I landed at the airport yesterday morning and I had a problem to solve. How do I get from the airport to the Congress Center? And there was one option. I'm only going to be here for a few days. I could have bought a car. I could have walked from the airport to a car dealership, I assume there's one close. I could have picked out a car,
put down whatever, a couple thousand euros, registered that car with the government. I assumed that on an American passport, I could buy a car, I don't even know, pay taxes. There's a lot that that would involve, right? I would now be maintaining that car. I would need to make sure that it had fuel. I'd need to navigate to the Congress Center.
And now I own this massive asset of a car for my trip to Switzerland. Might be a little bit overkill. So the other option that's pretty popular is maybe I could just rent a car rather than just purchase one outright. Maybe I walk down to the car rental, like Avis or something, and I say, hey, I'm gonna be here for four days.
Can I have a car for four days? And they're like, sure, here's the keys. You're gonna pay 50 euros a day, and this car is yours. So now it's a lot easier than buying a car. I don't have to worry about changing the oil. I don't have to worry about paying taxes or registering the vehicle. And now the only things I have to care about are making sure that it has fuel.
I still have to look up directions to the Congress Center. And for times like right now, where I'm not driving, I'm actually in front of all of you talking, I'm still paying for my rental car, whether I'm using it or not. I'm still paying that daily rate. So the last option, which is actually what I use whenever I travel, is Rideshare. And this is the ability, so that I really
go to the airport. I opened up the Uber app, and I said, hey, I need to get from the airport to the Congress Center. Immediately, a car pulled up. They said, hey, Jeff, come on in. I jumped in the backseat. Payment was taken care of. I didn't ever think about directions. I couldn't tell you how I got here. It just happened.
The driver was concerned about the fuel. The driver was concerned about directions. I just got in the car, got to my destination, and I only paid for that car during the time I was actually traveling. So why did I give you this wonderful monologue about the decision I made when coming to EuroPython? And the reason is because you can kind of think of this
in your different options for how you host your code and how you can run your code. So if I have a Python application that I want to run, I could go build or maintain my own servers. I could get virtual servers in the cloud. Maybe I actually use my own hardware. It's totally feasible. It's something I could do, but there's a lot of things
that now I need to manage and maintain. I need to make sure that those operating systems are up to date. I need to make sure that my machines have power. If I get a big load of traffic, I need to make sure that I have enough capacity. Those are all things that now I need to be aware of in managing. Now there's also these platform as a service offerings,
whether it's in Azure or in AWS or Red Hat or Pivotal. These are nice. This makes it so I'm not often managing the underlying machines, but I still am in charge of a few things. I need to make sure that it's scaled appropriately. I need to make sure that I'm following the kind of constraints of that platform service and very likely I'm paying a fixed cost
whether my code is actually running or not. Now serverless to me is very much like this rideshare world. In serverless, all you care about is your code. You write your code, you attach it to the event that you care about and you publish that to the cloud. Every other aspect of that application, how it scales, how highly available it is,
the security of the operating system, all of those aspects that frankly aren't that much fun to deal with get managed by the cloud provider for you. And the reason that this is appealing to a growing number of developers and teams is because it allows me to focus on solving the problems that I want to solve. And some of those other aspects that still need to be solved,
maybe I'm okay not being the person who's managing that. So for Azure Functions specifically, we have a few languages available today as we start talking about Azure Functions, .NET, Node, which includes JavaScript and TypeScript, Java. Python is in preview today, but I'm really excited. We're actually rolling out the general available update
for Python in this next week. So very shortly, if you keep an eye on blogs, Python will be generally available in a few short weeks and as well PowerShell as a language. Azure Functions itself is completely open source, so not included on this slide are some community contributed languages like Go and Rust.
And when we double click on Python specifically, there's a few key points that I wanna call out here. And after this slide, I'm actually gonna work through and we're gonna build a Python Azure Function together so you can actually see the experience. A few things, the first, Azure Functions is entirely open sourced. You can see all of the code for every tool, the runtime, the Python, all of that is on GitHub
and we love contributions from the community, so feel free to get involved. One of the awesome things about Azure Functions though, is that the rich development experience that you get and specifically with tools like Visual Studio Code. So we're gonna spend our time in Visual Studio Code today and it gives you things like local debugging,
rich IntelliSense, easy publish to the cloud. Now you don't have to use Visual Studio Code. You can use PyCharm, you can use Sublime, you can use any editor you really want. The tools work across all editors but we have a first class integration with VS Code. You can trigger your code and you can say, hey, I want this Python script to run on a number of different event sources.
It's going to scale automatically for you and if your code is never executed, if your code never triggers, you never pay any money and even when it does trigger, you get like a million executions free every single month. So very often, even when your code does run, you're still not paying us anything, so it's great.
You get some rich monitoring capabilities and you can also set up some rich CI CD, whether you're using Travis, Azure DevOps or any CI CD tool, Jenkins, you name it. So let's go through now that we kind of have an understanding of what serverless is, Azure Functions and Python and we want to build something. What I want to build is a simple function, a simple API
that can analyze the sentiment of some text, right? A very hello world kind of example and it's going to allow us to walk us through this experience in the tools. So I mentioned we're going to spend most of our time in Visual Studio Code, so that's where I'm at now, kind of an empty editor. I'll call out a few things. There's a few extensions in Visual Studio Code
that I'm going to be using to make our life even better. The first is this Azure Functions extension, which gives us some nice Azure Functions tooling. The other one here is the Python extension, which is going to give us some nice language options. I've got a lot of extensions, so it took me a while to get to the P's. Python, obviously all of these with Visual Studio Code
are all free and easy to install, but if you want to follow along at home, that's what you would need to do. So now that I have the Azure Functions extension, I can go ahead and click in here to the Azure icon and say, all right, let's create a new function. So I'm going to create a brand new project. We'll get a folder for it.
Let's call this one EuroPython. And the first thing it wants to know is what language I want to write this function in. Obviously we want to do Python, because we believe in the one true language of Python. And I have all of these different event sources. I could make this run every five minutes. I could make it run every Friday at 10 a.m.
I could have it trigger on an HTTP request whenever an image gets uploaded to an Azure storage account, or a message gets dropped in a queue, some data changes in a database. You get the idea. There's a lot of different event sources that can say, hey, go run this script. Now I mentioned we want to write an API for sentiment, so we're going to choose the HTTP trigger.
We're going to call this Analyze Sentiment. It's going to be the name of our function. I could require that there's a key and some authentication to invoke this function. In this case I'm just going to keep it anonymous, and we'll open it in the current window. So now the Azure Functions extension in Visual Studio Code
is going and scaffolding for me this function project. And it's gone ahead and opened for me now kind of the base template for an HTTP triggered Azure Function. So this is all the code that exists in my project. There's some metadata here that tells it what trigger it uses. I also have my requirements.txt file, which is empty right now.
But this is the only code that's actually in my whole project. It's very, very lightweight. It looks almost just like a simple script or a console application. But instead of getting passed in like some arguments, some string arguments from the command line, I actually am getting an HTTP request. So when someone triggers this function,
it's going to be an HTTP request. And I can now use pieces of that request, whether it's the body, query parameters inside my code. Now this simple template is just a hello world function. It's just going to look to see if you pass in a name. It's either a query parameter in the body of the message and return back a nice and friendly hello,
whatever your name was. Now what I want to show quickly here before we start analyzing sentiment is again one of the nice things with Azure Function is all of the tooling. So I'm going to go ahead here and set a breakpoint. And let's go ahead and say we want to start debugging. And this is going to go ahead and start a debug session here in Visual Studio Code. I didn't have to do a whole lot to do that.
I always want to show this flashy ASCII art. Right now on my MacBook, this could be Windows, it could be Linux, I'm running that open source Azure Functions runtime. So this is the same runtime that we'll be executing in the cloud. But in this case, it's actually running on my machine. It's noticed I have this HTTP triggered function.
And it's even given us this nice local endpoint that I can use to test. So let's test it out now. Let's go ahead and send a request to this function. So I'm going to go ahead here. I have another very cool Visual Studio extension that actually lets me send HTTP requests when I just annotate them with this cool annotation.
So I'm going to say do a post to that URL. And we want the content type to be JSON. And now this awesome Visual Studio Code extension called rest client will let me send the request right here in the editor. So I'm going to go ahead and send that request. And as soon as I click the send button,
my break point was hit. I'm now debugging this function. As I step through it, I can see that I got my name property. In this case, I left my name as Azure. My name's actually Jeff, but that's fine. You can call me Azure. And when I finish the debug session, I get back my response that says, hello Azure. So that's kind of the basic experience,
creating the function, debugging it. The last step that I would do here is publishing. But before we get there, let's actually add in some more complex code. I want to do that sentiment analysis like I mentioned. And I'm actually going to use a dependency here that maybe some of you have used before called text blob, which gives me a bunch of machine learning capabilities
to analyze text, pull out the key phrases, pull out the nouns, pull out the sentiment. And I'm going to replace this kind of basic hello world code. And I'm going to, faster than you could have believed, type in, because I didn't type it in, type in this code to use text blob to look at the text and pull out the sentiment polarity.
Now you'll see this in a second, but what it's actually going to return back is a number. That number's going to be between negative one and one. The closer to positive one is the more positive the sentiment. The closer to negative one, the more negative the sentiment. Let's go ahead here and make sure I'm importing the right stuff as well. Again, using my amazing typing skills.
So at this point, I pretty much have everything I need. I could actually run this right now and debug. And when I go ahead and run it, I could show you now if I say debug again, the first thing it's going to do is it's going to go ahead and pull in that text blob dependency and use it to run for me.
So if we now change this, it's now running the same thing. It's now analyzing sentiment. I'll go ahead and change this. I'm not passing in a name anymore. I'm type passing in text. I'm going to say, I am so, so happy. Go ahead and save that and click send. Oh, I left my break point hanging around. That's okay. And you'll see here, now I get a sentiment of 0.8.
This was very happy. I could even quickly come in and make this one change to I am so, so sad, and now it's negative 0.5. So my code's working. Now I have a simple Python script. It's going to get an HTTP request, and it's going to tell me the sentiment of whatever the text I passed in. Now, the one thing I want to call out when I use this library, this text blob file locally,
how it's actually working is that it installed on my machine, I'll show you this, at the home directory as part of the, what is it, NLTK library? There's these NLTK data models that right now are at my home directory that you can kind of see here.
When I publish this function, it's very important that my function has access to these same models. These are the models that my Python function needs. So in order to do that, I just need to make sure that I actually copy these models into my project directory. So now I'm here in the project directory, EuroPython, and I'm just going to copy the models,
NLTK data, into the current project. So now those models are available there, and I just need to add one more line. Oh, did my super fast typing not work that time? It did. And this line's just saying, hey, NLTK, you can actually find the models in the current directory.
Don't go look at the home directory, right? So just a pattern that's worth noting, if you're using things like models in your function, you can just include those models in your project directory column directly then. And now when I publish, which is the last step, it's going to take this entire directory, the Python script, the models, it's going to look at the requirements.txt file,
and it's going to put them in a zip, send them to Azure. Now one of the new features that we actually are just rolling out now, which I'm going to show you, is that when I choose to publish this, I actually don't need this flag anymore, TextBlob requires some native dependencies. It requires that I have native Linux dependencies
when it runs on Linux, when it runs on Macs it's different, when it runs on Windows it's different still. And rather than making you deal with the complexity of knowing, oh shoot, I just built this on my Windows or Mac, it's going to be running in a Linux container in the cloud, how do I get the right versions? One of the features that we have now is that when I go ahead and click publish,
and when I say now I mean rolling out in the next week or two, now for me, because I'm running these bits now. What it should do at first, oh actually, I need to make sure I've authenticated with my account, I realize I haven't done this yet. Antares demo, this one will work. What it's going to do is it's going to look at this function that I have,
realize that it's a Linux Python function, it's going to archive the directory like I mentioned, but the cool new feature I wanted to call out is that it's actually going to go pull down and do a remote build of any requirements that I've defined in my requirements.txt file. So it's actually going to use the Linux environment in the cloud to pull in the text blob dependency,
do all the building there. You can see it's doing the server side build right now, it's uploading my files. All this is done for me, so regardless if I'm developing on Windows, Mac, or Linux, I'm confident knowing that my app's going to run successfully in the cloud using this new server side build tools as part of the Azure Functions experience.
Now once this is done and we don't even have to wait for it fully, it's going to give me back a URL that then anybody could call. It's not a local host URL anymore, it's going to be a .azurewebsites.net URL that anyone could then call, pass in some text, and it's going to give you back a score. So it's that easy to kind of get up and running, include dependencies that you need,
include models that you need, and then finally publishing it to the cloud. In this case, I used the command line because I wanted to show off that new functionality. I could have also done the publish directly from right here in Visual Studio Code. So once this is there in the cloud, I actually have one that I published ahead of time because I figured that it would take a little bit to do the publishing and build on the internet connection here,
but I do have one that's a .azurewebsites.net URL. And if I go here now and just click the send request button, it's going to send the same text off to, in this case now, this cloud hosted function. And now running in the cloud, that same Python code is now available to anyone.
Now to kind of bring this home, I want to show you, hopefully you've seen, this is a very productive development experience. I can quickly get something like a Python script attached to an HTTP request and running. One of the other benefits here is the scale. The fact that now if everyone in this room tried to call the same API,
if everyone in this whole city tried to call the same API, I want to know that it's going to scale and be available to everyone. So to prove this and for the last five minutes, we're going to attach this to some data. So I'm going to take that same function that I just wrote to analyze the sentiment. What I actually want to do is I want to populate this real time dashboard.
So this dashboard's empty right now, it's very lonely. This is a product called Microsoft Power BI. And what I actually want to attach it to is I want this to tell me everyone in the world who's tweeting, and I want to know the sentiment of those tweets and where they're tweeting from. And the thing that's going to drive understanding the sentiment is going to be calling that Azure function we just published.
Now to attach it to some data, I'm going to use another serverless piece of technology in Azure called Azure Logic Apps. Now Logic Apps is a little bit different than Azure Functions because in this case, I don't actually create code. With Logic Apps, it's serverless in the same ways that it scales to zero or scales to N,
but here I actually create workflows, and I can integrate with different services. So I want to connect my Azure function to Twitter, just to show you some of how Azure Logic Apps works. There's actually over 200 out of the box connectors here that you can use in your serverless applications in Azure to connect to services like Twitter.
I'm scrolling down, you probably recognize these other ones. Hey, when someone uploads something to Dropbox, when someone adds something to GitHub, Salesforce, SAP on-premises, Dynamics 365, OneDrive, Google Drive, SendGrid, you get the idea. There's a bunch of services here. This is all function code that I don't have to write
because when I want to integrate with Twitter, I can just say, hey, let me integrate with Twitter. In this case, I want to trigger this whenever a new tweet is posted, and I want to listen for a trending topic. I looked today, EuroPython is trending locally, but there are a bunch of tweets globally around Spider-Man because the new Spider-Man movie's been coming out.
So I can now trigger whenever someone tweets about Spider-Man, check Twitter every 30 seconds, that's fine, and now start to call things like my Azure functions and say, hey, here's that Azure functions I just wrote, the EuroPython one, and I want you to go ahead and analyze the sentiment of that tweet.
Now, for the sake of time, I'm not gonna go build this whole thing from scratch and wait for you to watch me fill out the designer. Hopefully, you get the idea of how a logic app works. So I actually have a previous version from late last night where I actually built this entire workflow. It's only four steps, nothing too crazy, right? So I do the same trigger, trigger on Spider-Man.
The first thing I'm gonna do is I'm gonna analyze the sentiment. You'll see here I'm looking at the tweet text as the text that I'm passing into that Azure function we just published. I'm gonna then categorize this. I have another Azure function that pretty much just gives it a color. If it's positive, green. If it's neutral, yellow. If it's negative, red. And then the last one is I'm going to publish these all
to that real-time dashboard that I showed you a second ago. So now let's actually watch these functions scale. As soon as I click Save here, and we'll actually click Run so we can watch it debug, this logic app's now going to start listening to Twitter, and hopefully somebody in the world right now is tweeting about Spider-Man, and if not, someone in the audience could,
but I suspect they will. I picked Spider-Man specifically because it's been noisy. And you can see here's an example of one that just got executed, but I guarantee that there's hundreds more that are firing right now while I'm talking. You can see now that someone tweeted, far from home spoilers. Whoa, I'm not gonna read the rest of that tweet. Apparently there are spoilers in this tweet.
But the sentiment of the tweet, I can see it called my function, it got back a score of 0.1, and so forth. So kind of the grand finale, and crossing our fingers that this all works, this is where the suspense comes in, we should now see this Power BI dashboard. Hopefully I don't have to click refresh here. Oh man, this is the grand finale. This is the part that really has to work.
We should see this dashboard here. Okay, it's lit up, I just had to click refresh. So now this is filling up with data. And you can see here, there's been a few tweets that have come in. Not very many, not as many as when I ran this last night. It's a little bit earlier in the US right now where a lot of those tweets were coming from. But at least these five tweets have triggered. I can see the sentiment, they didn't provide a location,
they're all yellow with the green circle, that's super intuitive. But if I leave these on or if I keep refreshing, you'd be able to see this dashboard just comes to life. So if hundreds of people started tweeting, there's a few more. I see some from Europe, there might even be people in this room. Thank you for your participation if you did. Oh, not that location though.
This isn't streamed, right? But that gives you the idea. So the thing here, I was hoping this would have been a noisier Twitter topic, but the idea here is that if thousands of people were tweeting, that simple function, that 20-line function that we wrote just a few seconds ago can just automatically scale and be available to all of those requests as they come in.
That's really where Azure Functions comes in. I didn't have to think about that. You didn't see me SSH into any servers. You didn't have me configure any knobs of scale settings. I don't have to. I just say, here's my code, here's the event I want you to trigger on, and then let it go to work. All right, so for next steps, for the last five minutes, there's a few things here.
I'd encourage all of you to go give Azure Functions a try. Probably the best place to start is our Quick Start. This is entirely using the command line tools, so it does work with VS Code like I did, but if you're using PyCharm, if you're using Sublime, if you're using whatever other editor, the same Quick Start will work just great for you. And you can get up and running
and just run this all locally, even without an Azure account. If you do want an Azure account, I didn't have a link here. If you go to azure.com slash free, you can get a massive free credit. I think it's like 200 euros to get started with Azure, though Azure Functions is pretty much free for most everyone, because of the million executions a month you get for free.
We also have a video that walks through building an app similar to this one, just a different scenario. One of the things I wanted to mention is there's serverlesslibrary.net. This is a website that has a bunch of samples of different functions that people have written. So if I come here and I say, hey, I want to look at Python samples, these come from customers, these come from developers on our team.
You can see here there's stuff with like, hey, a Python one that does some serverless IoT. I know there's some here about data cleaning. One of our customers built a data cleaning pipeline using ML and Python. I could click in here, edit it directly in Visual Studio Code, or browse to the code on GitHub to give me some samples as I get started
in learning about what I can do with functions. If you're interested in the code I used with TextBlob, I posted that on my own GitHub account. And then finally, if you haven't stopped by the Microsoft booth already, please stop by. We've got awesome socks. We have many members from both the Azure Functions team, the Visual Studio Code team, Jupyter Notebooks. We're more than happy to help you.
Come talk to us, get some swag, get some of those socks and stickers. And if you're interested specifically on Azure Functions and serverless, we have a Twitter handle on the Azure Functions account, as well as my own personal one. Hopefully you've understood, and this gives you an idea of what Azure Functions are, how easy they are for you to get started with, and how you could start to take advantage of not having to worry about all those complex pieces
of hosting an application, and just get started with the code that you want, all using a fully open tool set in Azure Functions. Thank you all very much. It's been awesome being with you all here today. Thank you, Jeff. Great talk.
Any questions? We have some time. Please come to the microphones. Thanks, Jeff. Quick question. If I wanted to dockerize a number of small flask apps, and bang them up on functions, so I don't have to worry about them, can I do that now?
Is it viable for production? Yes, so I actually was debating whether I was gonna show this or not, as I looked in the, and if I heard you right, you wanna dockerize the functions correctly? So one of the benefits about Azure Functions being open source, and our kind of engagement with the open source community, is I've actually just come back into this existing project. I'm not gonna change anything. This is the one we wrote from scratch,
but I'm just gonna write this command to initialize a docker file. Now automatically, without me even having to do the work, this tool looked at the project, and it's actually generated for me here a valid docker file that will run Python functions in any environment that I wanna run them in. Now I could even publish these containers to Azure,
and have them run, because sometimes I might wanna say like, hey, I actually wanna customize the environment. I wanna install whatever, some package that might not be included in our image. You can do that here and publish it. But the other one that we're seeing increasing interest in is that I could dockerize this and run it maybe on premises. In fact, recently we've announced a project in partnership with Red Hat called KEDA,
which will give you serverless scaling, serverless event-driven scaling for containers running in Kubernetes. And KEDA works natively with Azure functions and containers just like this one. So if I wanted to run functions in a container, maybe as part of a Kubernetes microservices in the cloud or on premises, maybe an OpenShift,
using a combination of this docker file and things like KEDA, I can get the same serverless scale experience in a production-ready way right now. So definitely something that we've provided, actually first-class tooling support for those docker scenarios, and something that we hope many of you take advantage of. So great question. All right, I think we have time for one more.
Hi, thanks for the demo. I was wondering why is my Uber only allowed to rise for 10 minutes? Yes, you get kicked out of your Uber after 10 minutes in the function world. Yes, so Azure Functions, we have a few pricing models. The first one is the consumption one. That's what is published to you by default.
It scales to zero, it can scale up to whatever. And there is a 10-minute execution limit. That's there mostly because of how the consumption plan works where we're recycling machines very often. That's as much as we can kind of guarantee without us worrying that we're gonna reboot it. That said, though, we actually do have an option which is getting Python support actually next week
called the premium plan. And the premium plan has the same serverless scale. It's a little bit more expensive, as the name would make you believe, it's premium. But one of the features you get from it is you can actually have unbounded, I was making my hands very big, unbounded executions. So you could have executions that last for six hours, eight hours.
In the premium plan, it's the only place where we're not going to guarantee we're gonna recycle these VMs super often. So that's the model today. Although it's a common request, so feel free to keep giving us feedback as well. But it is an option. You just have to choose a different hosting plan. Great. Okay, so I think that's all the time. I wanna make sure that there's time for the next speaker to come up because there's an awesome keynote, I believe,
about public speaking, so a very good topic as well. So with that, thank you all again very much. It's been awesome.