Leon Welicki: Hello there and thank you very much for joining
us today in this new Azure Portal How To video. Today, we
learn how to create a function app and we have Byron Tardif
for that who’s going to show us all about that. So, thank you
very much for joining us, Bryon.
Byron Tardif: Thank you, Leon. Hello, everybody at home.
And what we’re going to do is we’re going to start here
from the Azure home page, which you can see that it’s a
very prominent create resource, and that’s where you’re
going to go for creating any type of resource.
In this case, we’re going to create a function app and it’s
right here. And what this is going to do is it’s going to load
the new full screen create experience. This is similar to
what you’d do with a web app or a storage account, so it
should be very familiar. You start by selecting the resource
group where you want this resource to be. In this case, I
have a functions resource group that I want to use. Then
I’m going to name my function.
If I give it a name that is already taken, you can see that
validation is happening on the fly, which makes it very easy
to know what you need to correct. In this case, I’m just going
to give it a unique name.
And I should be good.
The next option is what are you going to be publishing to
your function there? Basically, are you going to be writing
this as a piece of code? Or are you going to be wrapping in
a container. Azure Functions support both docker containers
as well as publishing code, so it’s really up to you
what you want to use. For my demo, I’m going to choose code
because that also lets me show you the fact that we have a
runtime stack selection, which basically tells the runtime what
is the code that you’re going to be writing on? You can do
PowerShell, Java, Python, Node.js, or in this case, I’m going
to use .NET Core.
And we support .NET Core 3.0 by the way. I know people are
asking for that.
Next would be what is the region where you want to host this?
In this case, I’m just going to go with Central U.S. because
it works for me. Then at this point, I could just go to review
and create and what this will do is it will default you to
consumption, which is also the serverless tier. So, in this
mode, you don’t need to configure your scale; your app will
scale automatically depending on the number of requests or
the time that it gets triggered. If you want to change that
and go into advanced mode, you could click into the hosting
tab and at this point, you can specify more advanced settings
for your function. So, for example, if you have a specific
storage account you want to use, you can select it. If you have
a preference over operating system limits versus Windows,
you can choose that. Usually depending on the runtime stack
that you’re selecting, we will make recommendation as a default.
But if it’s supported, you can always switch it around to
whatever fits your needs.
And then you come to the plan, which is basically the
underlying app service plan that is providing the compute
for your resources. When you’re in consumption, like I
said, you’re in serverless mode, which means you don’t
need to configure the size of the machine or the number of
machines. We will adjust that automatically, but if you go to,
for example, any premium plans that we have, this basically
lets you have the flexibility of consumption where your app
scales dynamically to hundreds of instances. But at the
same time, you have the predictability of an app service plan
where you know that you can have prewarmed instances that
are always ready to go. So, you pay less of a cold start penalty
that way.
For as far as option goes, we have three different sizes,
which are going to give you different number of CPU resources
as well as memory resources. And you need to keep in mind
that this is per instance. So, this can go to 100 instances
and you can have 14 gigs of memory per instance if you need
something like that.
The next option would be monitoring, and this is basically
representing the App Insights resource that gets created
alongside with your Azure function. And this is what we use
to monitor functions, so you can see your history of executions,
and you can trigger alerts and metrics and stuff like that.
You get one of these by default. We recommend people to
use it. And for most cases, it’s going to be free is I think
when you start going high on the data usage because you
have a lot of traffic that you pay per the amount of data
that you’re publishing to Application Insights, but for that
it needs to be like a pretty high scale app to start hitting
that.
Next, you go into tags. Tags are what people used to, for
example, add additional metadata on their resources. They’re
also useful if you, for example, have a cost center. You can
always tag your resource with the cost center, and the tags
are propagated all the way down to your bill. So if you’re
wondering how much this particular application is costing
me that is using several Azure resources, tags is a good way
to go.
And then finally, we can go all the way to review and create
and this is going to give us a summary of all of the things
that will be created. So, you can see what description you’re
targeting. You can see that you’re creating a new storage
account. You’re creating a new App Service plan and you’re
creating a new monitoring resource and in this case, Application
Insights as part of the creation of your app.
And when I click create, we’re going to do the validation which
basically checks to make sure that all of your inputs are proper
and correct. There shouldn’t be anything that gets in the way
of you creating this resource. If there was anything, we would
flag it and then it gives you an opportunity to correct it
before you actually execute the create.
Leon: Thank you very much, Byron.
And thanks every one of you for watching the video. Please
leave us a comment on the video, follow us on Twitter and
look forward to seeing you in the next video. Thanks for
watching.