Learn how to configure an Azure function and prepare the Azure function for use with a stateless machine.
- [Instructor] To get started, click new. When the menu comes up, you can search for Azure functions. We're going to put in the keyword function, and there's Function App. That's exactly what we want for our Azure Functions. It comes back and gives us a summary indicating that we're in exactly the right place. So let's click Create. And now it's time to configure the Azure function.
The first thing we want to do is give it a name. I'm again going to prefix with jl and I'm going to call this MyAzureFunction. We'll choose the subscription, and once again I can choose among my various Azure subscriptions. Let's create a new resource group for this, as we deleted our old resource group. And now let's look at hosting plan. There are two types of hosting plan, the consumption plan and the app services plan.
If you choose the consumption plan, you will only be charged for the execution time when your function is running, and that's the one we're going to use. In fact, that's the one you'll use virtually all of the time. To get a sense of the cost of Azure functions, let's go to Microsoft's pricing page. Scroll down just a bit. And here we can see that you are charged for execution time and for total number of executions. Execution time is measured in gigabyte seconds.
That is, take the total number of gigabytes that your function uses and multiply by the total number of seconds, and multiply that times the cost. In this case, 16 10,000th of a cent per gigabyte second. Total executions is simply measured in how many times your function is executed, and you pay a fixed price per million executions, where the first million are free.
We continue with filling out the configuration information. Let's choose the location of Western US. And we can decide how we want to manage our storage. You can see by hovering over that it supports Blob Storage, Queue, Table Storage. Table Storage we're going to cover in an upcoming video on data. We're going to create a new storage plan, and it's already named it for us, and we'll keep that name.
That's perfectly fine. We'll pin this to the dashboard and we'll click Create, and that's going to configure for us our function app. Within our function app, we can have any number of Azure functions. It takes a few minutes to deploy, but once it does, we'll be able to create our functions and decide what events are going to cause them to run.
- Examining and personalizing the Azure portal
- Creating an app service
- Creating an ASP.NET application with Visual Studio
- Viewing your published app
- Creating a virtual machine
- Triggering Azure functions