The course is part of this learning path
This course touches on the similarities and differences between AWS, GCP, and Azure serverless functions. The idea is to give you insight into what using the different offerings look like. The primary learning objective is to help you make an informed decision about which provider to use and if it fits your use case. The 30-minute course covers the three different providers (content largely taken from the comparing cloud platforms course--but cut down for content), deploying a sample application on each, and the ecosystem around deploying serverless applications. The provider lesson uses the same application and demonstrate deploying and other operational characteristics of each provider.
- IT Pros
If you are not already familiar with serverless start with "Getting Started with Serverless Computing” before continuing with this course. You’ll also need some experience with cloud providers as well. Nothing specific is required, though you should have a general idea of how cloud computing works.
- Understand the state of serverless in 2017 List trade-offs between AWS, Google, and Microsoft platforms
- Learn to build, deploy, and run applications on the three platforms
- Learn open source tools for building serverless applications
This Course Includes
30 minutes of high-definition video.
What You'll Learn
Course Intro: What to expect from this course.
Serverless Overview: In this lesson, we’ll introduce you to the key players and prepare you for the hands-on demos in the following lessons.
AWS Lambda: In this lesson, you’ll learn about serverless on Lambda and deploy a Lambda function.
Azure Functions: In this lesson, we’ll discuss serverless Azure functions and learn how to deploy an HTTP function.
Google Cloud Functions: In this lesson, you’ll learn about serverless on Google Cloud and deploy an HTTP trigger function.
Ecosystems and Tools: In this lesson, you’ll learn about serverless framework and Apex.
Conclusion: A summary and review of what you have learned.
Hello and welcome back to the Serverless Survey course. I'm Adam Hawkins and I'm your instructor for this lesson. We're talking Azure functions in this lesson. Our objectives are to deploy an HTTP function, work with logging and monitoring and set up continuous deployment. Let's begin. Open your Azure console, navigate to the new function app builder. Azure function apps contain multiple individual functions, each with their own configuration.
The function app is just a place with an alternate. Here I'm creating a new application and resource group in this example. Azure works differently compared to GCP or AWS in that they use subscriptions, resource groups, and hosting plans. I suggest you familiarize yourself with this model if you plan to adopt Azure. We'll let the wizard sort out those bits for now. Also, I'll activate application insights for enhanced locking and monitoring. We'll take a minute or two to create the application, which you can track the progress in the menu bar.
Now note the token query parameter. This is used for one of Azure's authentication modes. This is a whole other topic you'll need to explore if you plan to adopt Azure functions. For now, let's explore other day-to-day features. Let's play with logging. The logger has common log levels, or trace levels, in Azure terms. I'll update our function to log the request headers in this example. Now save and run the function. This uses a pre-loaded sample data created by the wizard. Now, results are shown on the right and the logs are shown below. You can also stream logs in the Azure console as well as configure the log or trace log.
Let's switch gears and talk about monitoring. Azure functions are directly integrated with Azure application insights. Remember that I activated that when we created the function. Now open the dashboard manually. Search for insights then select your application. You'll end up in a powerful telemetry tool. The live metrics stream gives you the biggest bang for the buck. Now I'm generating traffic with a load testing tool for this demo, so let's let it stream for a bit. Watch closely and you'll notice that Azure automatically scales up the application.
There's much more you can do with application insights, so put an investigation point on your to-do list for now. One last thing before wrapping up with Azure functions. Azure supports continuous deployment for function applications from various sources. Now personally this is one of my favorite features and I think one of Azure's killer features, so let's configure that now. I've split the screen with the Azure console on the left and my terminal on the right for git commands. Head back over to the function application dashboard.
First, I'll download the source code for the demo function in the settings. Now let's create a GitHub repo for the source. I'll just make the initial commit for now, but don't push it yet. Now back in the Azure console, we want to configure the GitHub deployment option. I've already authorized my GitHub account, so you'll need to do that if it's your first time. It'll stick the parts you want on GitHub and branch. Now make a commit that changes the hello message in the function. Commit it and push it. Wait a second and Azure will deploy it. Now refresh the browser window, and you should see you changed message.
So Azure takes care of all of that for you, but note that Azure functions do not support deployment slots like some of the other Azure services. Luckily, this is currently in beta, so for now you need to solve the problem in source code branches. That's it for the demo, so let's discuss a few other details before wrapping up. Azure supports multiple runtimes, and even more exotic ones like bash or powershell via custom functions. Functions themselves may be triggered by HTTP, scheduled timers, or events from other Azure services. There's also a local function emulator.
The emulator allows you to build, develop, and debug functions locally before deploying to production environment. Also you have control over the application environment variable for runtime configuration without code changes. Azure functions offer many authentication schemes. This is another big topic to look into, and finally, don't forget about application insights. Insights include a complete analysis tools, custom metrics and alerts, and even uptime monitoring, all of which are a must for production applications. That's all for Azure functions. Next lesson introduces the newest contender, Google Cloud functions, see you there.
About the Author
Adam is backend/service engineer turned deployment and infrastructure engineer. His passion is building rock solid services and equally powerful deployment pipelines. He has been working with Docker for years and leads the SRE team at Saltside. Outside of work he's a traveller, beach bum, and trance addict.