In this video, Sharon provides a high-level overview of the Azure Function service, including use cases, a sample workflow and supported integrations.
- [Instructor] We can use Azure functions to implement event-driven actions in our applications. Functions use a serverless architecture, meaning you don't have to provision VMs. All you're going to do is run your code on demand and you can scale on demand as well. Some typical use cases for functions include tasks that need to be scheduled, if you like to integrate systems, or processing tasks such as ordering processing, product searches, shopping carts, or file maintenance.
Let's take a look at an example workflow. We have our user, they're using a web app, and we have functions which will then search our products. We have a function to search products and we have a function to get the product from that product catalog which is being pulled from SQL. There are several supported integrations for Azure functions including integration into Azure event hubs, Azure mobile apps, tables, and Azure Cosmos DB, Azure notification hubs, Azure Service Bus, queues and topics, Azure Storage, blob, queues, and tables, GitHub for WebHooks, on-premise using the Service Bus once again, and Twilio for SMS messaging.
Let's go ahead and pop into Azure and quickly create a function. I'm already in the LIL messaging resource group. I'm simply going to click on add and search on function, select function app, highlight it, the blade for the function app pops up. We can go ahead and click on create and add in an app name. This does need to be a unique name.
Select your subscription, your resource group. Next, you could select your hosting plan so you can use the consumption plan or the app service plan. The default is the consumption plan and resources will be added dynamically as required to our functions and you only pay for the time that the functions actually run or you could pop it under the app service plan if you wanted to do so. Pick your location and you can either use an existing storage account or create a new one. I'm going to go ahead and create new and I'm leaving application insight turned off and create and this will take a moment.
Now that the function is being created, I'm going to go ahead and close down these windows and refresh the page and we can see that our function is now available. I'm going to go ahead and select it. First thing I'm going to do is expand the functions tab and here we can go ahead and get started with a pre-made function. For our example, I'm going to choose WebHook plus API. Next, you're going to go ahead and choose your language and I'm just going to go ahead and create this function.
Now that function will have been created. Now, I'm not going to lie to you. I am not a programmer by any stretch of anybody's imagination. So, at this point, I'm going to go ahead and close this and that will close down the function window. And because I am not a programmer by any stretch of the imagination, I can't emphasize that enough, we have an Azure functions first look course within the library. You'll learn more about Azure functions through that course.
The key takeaways when talking about functions in Azure as it comes to application integration is that functions leverage a serverless architecture and we're running code on demand.
- Creating compute-intensive applications
- Creating long-running applications
- Implementing messaging systems
- Azure Service Bus relays
- Using Azure Storage queues
- Creating an Azure Event Hub
- Creating Azure WebJobs
- Managing cloud environments with Azure Active Directory Domain Services