Azure Functions: A Comprehensive Guide For Beginners
Azure Functions: A Comprehensive Guide For Beginners
Azure Functions: A Comprehensive Guide For Beginners
Serverless computing
By the time you have read this eBook, you will have a strong under-
standing of how to develop serverless solutions.
2 | www.simplilearn.com
What is an Azure
Function?
Writing Azure Functions is new, which presents excellent “early
adopter” opportunities. Many companies are still deciding
whether or not to adopt cloud services and have not made the
pivot to programming in the cloud. At its core, Azure Functions
programming manages events that drive functions executed on
the cloud. In this section, you will learn what serverless computing
is, what an event-driven architecture is, how to program in the
cloud, and the history of Azure Functions.
Serverless computing
Serverless computing is a revolution in software and hardware
design—one that provides us the power to be truly autonomous,
powered by machine intelligence. IT has used the same familiar
tools of management and deployment, with one differentiator—
now they can run applications serverless without the need for a
traditional IT admin. Serverless computing is already being used
by the world's most extensive cloud services, like Azure, and is
rapidly growing in popularity with companies like Uber, Airbnb,
and Netflix.
3 | www.simplilearn.com
is compiled and runs on the cloud as needed. Running code on the
cloud provides the same benefits of scale as other cloud services
such as a database. If there is a need for a more massive database,
the cloud will automatically scale to support the demand. In the
same way, programming in the cloud will scale to meet demand.
Event-driven architecture
The functions written with Azure Functions and other cloud
programming languages are event-driven. This means that you've
got basic controls such as clicks, but you also get things like
sockets, files, and custom functions. You can use these as event
channels.
It's also effortless to pass data into any of these functions using
the SignalR library. So, for example:
This will send a signal to the program that a transaction has been
processed. It will also create an error event to indicate if the
transaction failed.
If you want more control over which functions are called, you can
add additional features.
4 | www.simplilearn.com
an IoT connected device such as a Raspberry Pi. Azure Functions
can also be used to manage back-end services triggered by
custom HTTP requests, and "spin down" services when not in use,
to effectively manage the resource.
Synchronously
Asynchronously
5 | www.simplilearn.com
In other words, Azure provides you, the developer, many ways in
which to interact with functions.
1. Go to https://portal.azure.com/#home
In the next section, you will create your first function. If already
have any functions, you will see them listed on the screen. If you
want to create a new function, you can do so by selecting the
“Create function” button. More on that in the next section.
6 | www.simplilearn.com
Writing your first Azure
function
In this section, you are going to write your first function. You will
need to have an active Azure account for the following steps to
work. Signing up is easy and you do not need to use your credit
card.
7 | www.simplilearn.com
4. We are going to make it easy to get a basic function up and
running. There are a couple of fields you need to enter. The
first will be a “Resource Group”. Go ahead and name yours
“MyFunctionApp.”
8 | www.simplilearn.com
5. You will need to give your app a unique name. In this example,
the name is “SimpliLearnFunction”.
6. Publish as “Code”.
9 | www.simplilearn.com
8. Press the “Review + Create” button.
10 | www.simplilearn.com
10. It will take up to five minutes to create your default app.
12. From the center of the screen, select the “New Function”
button to add a function to the app.
13. You will be offered several ways to create a function. For now,
select the “In-Portal” option.
11 | www.simplilearn.com
using System.Net;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Primitives;
using Newtonsoft.Json;
16. You can test this code. Select “get function URL” to copy the
URL.
17. Paste the URL into a Web browser window. By default you will
get the following error:
18. The get a positive response add the following variable that the
URL is looking to have parsed into the code “&name=Matt” and
then hit return to the following:
There is a lot more you can do with functions, but this gives you a
basic understanding.
12 | www.simplilearn.com
Managing Fees
Nothing is free, but Microsoft does do its best to keep fees
transparent. Azure only charges you for what you use. This is
the model applied across most Azure services. Azure Functions
generates revenue for Microsoft each time a function is run. It only
takes milliseconds for an event to run (typically 200 milliseconds)
with a cost for each event. Each event is known as a Request.
Also, Microsoft will charge you for how long it takes to run a
function. The final charge is Request x Duration.
Also, your free tier can have time limitations. Use the Portal to
keep a close eye on how you use your Azure Functions.
13 | www.simplilearn.com
overhyped and that there was no reason to be excited about it. For
one, functions were written in JavaScript, so they required server-
side scripting. While this made the API harder to use, the platform
was also viewed as a hassle for developers. Developers would end
up rewriting hundreds of lines of code with snippets of JavaScript,
then writing function invocations to move the function execution
forward. However, this was done without any serious rework to the
Lambda code itself, so the system was held up for a while.
Internet of Things
Codeless development
14 | www.simplilearn.com
The Future of Azure
Functions
The future of Functions (and I/O-heavy scripts) can be split into
three key areas:
Increased capabilities
If Microsoft can make this work, we will likely see more and more
"size" in our usage of Azure.
Having limits to the size of your functions will also make scaling to
new regions a lot easier than scaling in existing regions, which will
be a big win for users and developers.
15 | www.simplilearn.com
and reliable architecture. This provides more resources to the
front-end developers in terms of modules and components, which
makes framework deployment efforts much easier.
In short, what you can expect is that Azure Functions will continue
to expand in scope and capability as developers explore the full
potential of serverless applications.
16 | www.simplilearn.com
Founded in 2009, Simplilearn is one of the world’s leading providers of online training for Digital
Marketing, Cloud Computing, Project Management, Data Science, IT Service Management,
Software Development and many other emerging technologies. Based in Bangalore, India, San
Francisco, California, and Raleigh, North Carolina, Simplilearn partners with companies and
individuals to address their unique needs, providing training and coaching to help working
professionals meet their career goals. Simplilearn has enabled over 1 million professionals and
companies across 150+ countries train,certify and upskill their employees.
Simplilearn’s 400+ training courses are designed and updated by world-class industry experts.
Their blended learning approach combines e-learning classes, instructor-led live virtual
classrooms, applied learning projects, and 24/7 teaching assistance. More than 40 global
training organizations have recognized Simplilearn as an official provider of certification
training. The company has been named the 8th most influential education brand in the world by
LinkedIn.
© 2009-2020 - Simplilearn Solutions. All Rights Reserved. | The certification names are the
trademarks of their respective owners.
17 | www.simplilearn.com