Azure Functions

Video Activity
Join over 3 million cybersecurity professionals advancing their career
Sign up with

Already have an account? Sign In »

14 hours 28 minutes
Video Transcription
Hello, Siberians. Welcome to lessen 7.1 off Model seven off this car stated. Is that visitor one Microsoft Azure Hock Tech design.
Here. The landing objectives for this video
who started by discussing as your function on dhe just introducing you toward a Najar function. Happy's
then proceeds to cover the cough features off as your functions,
then required and cover the wrong time visions that exist. Five. Your functions that there are three men one time visions but will cover the differences between them on most importantly, which ones should be using when designing the solution?
Well, then cover the different Austin plant options that are vilified your function, which determines how you're going to pay for your functions and also has a big impact on your architecture in terms of scalability.
Then we'll cover our as your function works and go into a bit more details we got in the service
wouldn't conclude by talking about as your function from a cost perspective.
Let's get right into this.
So let's start out by understanding what is your function? Happy's so as the function Abaza service in Azure for running small pieces of court in the cloud what does that mean? What that means is that rather than focusing on a whole application,
we can break down the application into smaller logic set on implements this small a logic set. US Micro Service is
running in azure functions, so it fits very well into in micro service's architecture.
One of the other fish in a barrage of function hap it's that it is an extension off the Azure hap Siri's so Harder feature said that applies to Azure Up. Seven is also applies to azure function, hap
in terms of some of the other car features off as your functions.
It's support multiple languages from see shop or the words of scripting language is like power shell times off price and option. They're different options that we have on our pay fires. Your functions we can either pay and something called consumption based is dynamic a pay as you go or we can pay for dedicated resources
so we can We can have dedicated overserved
resources available for function have to run it
also, when it comes to the service's. I mentioned this earlier as your functions is an extension off as 1/2 service was a witch Ms Left, features like Israel. 80. Integration for easy half also what realize your functions
So it has negatively butin integrations with service's and hodja like cause, most baby an event up on notifications. Hope, which means you can
read data very easily with from the service is, or you can use them a streakers for you as your function. So it is that done. Native integration, that beauty and also for service, is like get a job and even service is like service boss. So as your functions, Astra visions off the one time
Now How'd off this revisions of the runtime on Lee to a currently G eight on that's generally available in that division? One on vision, too,
on one of the other feeds toe notice that only G A releases are supported for production, which means even though you're seeing vision to be on the slide right there,
it's not something that you want to use in production.
One of the other things to mention is that Vision one is currently maintenance mode, so announcement have provided on Lian later visions and the water vision to envision tree, so also try to stay away from vision one, if you can on just use vision too many
when we create a function. Apin agile. One of the things that we have to choose is a Austin plan for what happened, and we have to re Austin plants that are available.
We have the consumption plan
on the conception plan. The men case about this is that the APP can scare hope and scale down based on the load that comes in, not something that we need to configure, not something that we need to predetermine. It's set of resources that will be available tohave, we simply say, as a code to run
as much compute power as that coordinates to run based on the loads that's coming in. Make that available to the court. So that's the consumption plant.
Then we have the premium plan
on the premium plan has some key functionalities that doesn't exist in the other's. Number. One is something called pre warmed instances. Now, with as your function like that, said the conception plan. If there no event or execution off the court,
the happy can scale down to zero instances on what it means is that all of a sudden it is a new trigger. It takes time to implement the back and infrastructure that we want. The code on toe warm it hope so that can lead to Italy. What premium plan allows us to say is to be ableto predefined.
A seven number off instances that we always stay one so that our court can
whenever it's triggered can execute as quickly as possible. Right? So that's one of the advantages off using something called off using this premium plan one of the other advantages that it has it I support Virtual network connectivity is in service end points.
Then we have the dedicated plan.
The dedicated plan is where we're taking our larger functions and we're running, eats in and as you're up servicemen and as you have seven friends where we redefine a set off resources on the number of resources that our back and can scare too. So we prayed to find that ahead of time.
Just be aware that if you're using the AB service plan requires that always on is enabled.
Let's have a look at our job function works.
The first constructs that we need to implement as your functions is we need a function hap. The function have is what most our coats are. Cord runs within the function happen on our cord is also referred to as functions on. We can have multiple functions running within a function happen
enough our code to run its need to be tree get
What are the options that we have when it comes to triggers
some of the options you can see on the left hand side. So, for example, we can trigger the execution of our code that Allstate with dinner and as your function have based on an event greed subscription, which I'll show you that in the demo based on data being added to Cosmos Deby Collection
based on event hop based on http tree guys, one of the common ones, every based on the shadow.
Why so you can say this court executed based on the shadowed frequency based on service possible that some of the
triggers that we have on the left hand side how so within our coat
de maybe instances where we needs to pull in sudden information,
maybe from another service
Those are called impute bindings in Hajer functions. So impute by Dean is a way to supply data or integrate with the service and be able to supply data right into our quarter. Inject that into overcoat
in terms off imp input bindings as your function as multiple options off what we can implement. So, for example, we have the blob storage cosmos TB graph FBI signal out table savage and multi porters. We can only have one trigger,
but we can have multiple input bindings. So, for example, in the case that I have on the screen the trigger objects, tree gas, the execution of the cord and then the court begins to execute. Now we did not. Could we make it called for the input binding to grab some data from Cosmos Day? Be on, then we pull in that data
on dhe. Then another part of our court maybe does some processing on that data. So you were using put bindings for that? But we can have multiple input bindings,
but on the one trigger
also, we wantto outputs the data or the information
to somewhere else
that's called out on binding our house with binding in as your functions.
Not without one bindings. They're multiple bindings that are available. Who also, so they're just some that I'm listing on the screen. This is not by any means an exhaustive list just to give you an idea. So, for example, we could not take that information after that. But the output of our code on then puts that into Cosmos d Be some, well,
puts that into a queue or past that into event hub, or just put that into
a bluff stoppage.
Let's look at the http tree gift for you minutes
with the edge into poetry gear, which is very common.
It's a simple as making an issue terrific question. You are Oh, that's generated whenever we create our function, and that's how you trigger the function to execute.
But we can also control what's allowed and what's not allowed or in what way can our function. Ba Trickett reason http.
So, for example, we can define the methods that are acceptable, or the method that allowed we can choose get only accepted
if what we want is a function that only accept request. But that does not allow any rights,
or we can choose to allow posts or their order issued to be metals that we can choose to allow or not allow.
We can also define the authorization level that we want. Anonymous level means any wonder has the u. R l can make a request to eat on a country? Got the function to execute
function level means that the function key
will be required before you can trigger dysfunction. So whenever I create a function, it generates an AP ikey on di p i ke. You need to supply that within your HDP Heather before you can trick at the function. If it isn't function level authorization
if you use an admission or system level authorization. What that Mrs say for the function up itself that can contend multiple. Function it as a key and one that has the key to that function up itself. Country. Get any of the other functions within that function? Hap.
So that's what the admiral system levels identifying, too. But we have control over. That is what I want to get across to you.
Let's look at some of the design decisions off azure functions like let's look at cost
when it comes to costs. We mentioned earlier that we have the consumption model or we have the azure half serviceman or we have the premium plan. When it comes to the consumption model, which is one of the most popular options, 1,000,000,000 is based on the number of executions, the execution time on the memory use. That's what we pay for.
So you say, For example,
if you have a function consumes about 0.5 gigs of RAM
and that from Truman runs for three seconds, then the execution costs would be Israel 30.5 giga byte of Render. The function uses times the amount of time that the function is executing for and that is it would all be equals to 1.5 gigabyte per seconds. And that's what we pay for.
So what that means is I function that once for longer
costs more. So. If your function is busy unloading all these dependent things and doing all this other stuff, it's going to cost you more in terms of execution because you're paying us Ugo,
also a function that consumes more memory.
Also, it's gonna cost more, so be a well off does now when it comes to 1,000,000,000 billion is aggregated across our function within the function up. So we're gonna pay for it at a function up level on is gonna chat for how the functions that are running within the function hap.
There's a free grant that included on the past subscription basis I light in here. There's a frequent off 400,000 gigabytes per seconds that's free
in terms of memory. On attempts off execution. This 1st 1,000,000 executions are free. But be aware that this freak grand is on a pass subscription basis, not on a past function basis.
Also, there's no downside er impact having multiple applications running in the same consumption plan. So if you're worried about air, would this affect performance and some of the other stuff? There's no downside an impact if you have multiple from Trump's Running with Dean, a single function app
still talking about costs whenever way using Nigel functions. The other cause that we have to be aware of Beyonce's just a function appetite, for example, we cannot create on as your function help without a storage account on that storage account to be beaute. Also for the billions off stoppage account,
it's also a good practice tohave application insights which will be able to give us more telemetry as to the monitoring off larger function, and that also has its own cost.
And, of course, we pay network band weeds for data that's transferred outside of the video outside of Asia. There is a cost to that. So there has been transformed within the same region
is not touch for so maybe that's gonna affect our you architecture solutions. It brings me to the hand off this lesson. Thanks. Right, but for watching and I'll see you in the next lesson.
Up Next