How to Create Azure Functions App
Azure Functions makes the app development process more productive and let you launch serverless applications on Microsoft Azure.
It helps you process data, coordinating with different systems for many platforms and components, for example, IoT, integrating various processes and procedures, and building simple APIs and microservices.
Function-as-a-Service (aka FaaS) becomes a generic term for serverless and reduces infrastructure considerations. Azure VM and servers are still there, but you don’t have to worry about managing or provisioning them because it’s a native part of Function.
You can scale according to demand. To build the apps themselves, the developers can use their own programming language choice, giving them the freedom to work optimally.
In this article, you work through how to use Azure Functions to create a basic example of “hello world” with HTTP trigger function.
Work with Azure Function
You must have a function app to host the execution of your functions. A function app lets you group functions as a logical unit for easier management, deployment, scaling, and sharing resources.
To create an Azure Function app and HTTP trigger function, you need to be at least with Contributor permission, and once you’ve got the required licenses, you can start with this guide and create the app and function.
How to create Azure Function App
From the Azure portal, select Create a resource and then select Compute > Function App
Another way is to search “Function App” from the Azure Portal search bar
from the Azure Function page, choose to Add or Create Function App
Next, on the Basics page, add the relevant function app settings specified in the following table. Then, select Next: Hosting.
Note:
On the Basic page, add the following settings for your Subscription, Resource Group, Runtime stack, and additional settings.
Subscription | Your subscription | The subscription under which this new function app is created. |
Resource Group | myResourceGroup | Name for the new resource group in which to create your function app. |
Function App name | Globally unique name | Name that identifies your new function app. Valid characters are a-z (case insensitive), 0-9 , and - . |
Publish | Code | Option to publish code files or a Docker container. |
Runtime stack | Preferred language | Choose a runtime that supports your favorite function programming language. Choose .NET Core for C# and F# functions. |
Version | Version number | Choose the version of your installed runtime. |
Region | Preferred region | Choose a region near you or other services your functions access. |
Next. on the Hosting page, enter the following settings.
Then, select Next: Monitoring.
Setting | Suggested value | Description |
---|---|---|
Storage account | Globally unique name | Create a storage account used by your function app. Storage account names must be between 3 and 24 characters in length and contain numbers and lowercase letters. |
Operating system | Preferred operating system | An operating system is pre-selected for you based on your runtime stack selection, but you can change the setting if necessary. |
Plan | Consumption (Serverless) | You are hosting a plan that defines how resources are allocated to your function app. In the default Consumption plan, resources are added dynamically as required by your functions. |
On the Monitoring page, enter the following settings.
Setting | Suggested value | Description |
---|---|---|
Application Insights | Default | Creates an Application Insights resource of the same App name in the nearest supported region. |
Then, select Review + Create to review the app configuration selections and to create the app
once the app configuration completes, you can access
Create an HTTP trigger function
Once the App is created, you can continue and create Function, and this guide focused on HTTP Trigger Function.
On the Functions window’s left menu, select Functions, then select Add from the top menu.
From the New Function window, select Http trigger.
Next is to add the following details for the HTTP Trigger:
- Accept or create a new name.
- Choose Anonymous from the Authorization level drop-down list.
Then select Create Function.
Now, you can run the new function by sending an HTTP request.
Test you Azure Function
On the new HTTP trigger function, select Code + Test from the left menu, then select Get function URL from the top menu.