Join Tiago Costa for an in-depth discussion in this video Create an Azure Function, part of Developing Long-Running Tasks with Microsoft Azure.
- [Instructor] So now let's create an Azure function using the Azure portal. So to start I'm just going to click under creator resource, and I'm going to search just for function, and there we go. First result, function app, and we click create. So now I just need to type a name for my function and I will just call lilFuncDemo. It's available, I'm just select the default subscription that I have. I can create a resource group or just use an existing, I will just go for an existing one. I can select which is the operating system of my functions, I can select Windows and currently Linux is under preview. I'll go for Windows, and the hosting plan, like we saw before so in here is where I can select if I want an App Service plan, or a consumption plan, the consumption plan of course will have enormous advantages that I don't need to congfigure and worry about scaling and all that. Location, runtime stack, I'm just going to leave everything under their defaults, and I'll just click create. So our deployment is in progress, so there you go, our deployment has finished. I will just go here under function apps, and my function should just show up in here. There you go, this is my function app, and if I click in here, so now I just need to create a new function under my function app, and now I can select, well, am I going to develop this under Visual Studio, Visual Studio Code, another code editor, or through the portal. I'm just going to select through the portal, and now I can select if I want to webhook API, or a timer, or I can even see some more of the templates. For me, and for demo purposes, I'm just going to select this one here, because this one is the one that just receives an HTTP request. So let's click create. So there we go, we have our function here. This is the structure of the function, and you can edit all the code that you have in here through the Azure portal, which is amazing, so just a browser and you can do everything through the browser. In my case and for demo purposes I'm just going to stick with the default app that basically what I'm doing on this one is I get an HTTP request and in the body of the HTTP POST you need to send a body with a variable called name, and then I will pass that name and I will just basically respond yellow comma, and then the name. So let's just run our app, we have run our app and now if we scroll here slightly to the right, we have test interface, and under the test interface, as you can see in here, so I can have like name, I can just replace the name in here, let's just call this LinkedIn Learning, and then if I call this again, so if I just run this again, I will have an output here that will just say yellow LinkedIn Learning, so there we go. Of course this is just a demo, we're just basically sending a name, but of course on the code of our app remember we can do image processing, rendering videos, we can go for CRUD operations, all sorts of long running tasks.
Released
3/27/2019- Creating and using Azure Storage queues
- Using Azure Service Bus queues
- Security for Azure Service Bus queues
- Creating and scheduling WebJobs
- Creating Azure functions
- Running Azure Batch workloads
Share this video
Embed this video
Video: Create an Azure Function