How to create a Function App in Azure

This Azure article will discuss the easiest approach to creating a Function App in Azure using Azure Portal.

Create a Function App in Azure

Before going to discuss the steps, as prerequisites, we need the following things

Prerequisites

  • You should have a valid Azure Subscription or an Azure Account. If you don’t have an Azure Account till now, create an Azure Free Account now.
  • You should have an Azure Storage Account. If you don’t have a storage account till now, Create a storage account now.

Follow the below steps to create Azure functions in the Azure portal.

1. log in to Azure Portal (https://portal.azure.com/)

2. Click on the + Create a resource, and from the New Window, click on “Compute”. Now, choose “Function App.”

create a function app in azure

3. On the Create Function App window, on the Basics tag, provide the below details.

  • Subscription: Choose your Correct Subscription.
  • Resource Group: Choose your Existing Resource Group, and if you don’t have any existing resource group, you can create a new one by clicking the Create new link.
  • Function App name: Enter a valid Function App name.
  • Publish: Choose the Code option.
  • Runtime stack: Choose the .NET Core Option.
  • Version: You can choose the 3.1
  • Region: Select the Region for the Function App.

Click on the Next: Hosting > button now.

Create Azure Functions Using Azure Portal

On the Hosting tab, Select the storage account or create a new storage account by clicking on the Create new link.

How To Create Azure Functions Using Azure Portal

Keep the default option for all other tabs as it is. Next, click on the Review + Create button. Now, it will validate all the fields and show the Create button. Now click on the Create button to create the Function App.

Now, you can see the deployment is completed successfully.

Create Azure Function in Azure Portal Step by step

Now you can see the new Azure function app is created Successfully.

Create Azure Function Apps Using The Azure Portal

So, we have created our Azure Function App. Now, we need to create the Functions. So click on the Functions link from the left navigation and click the + Add button to create the Functions.

create azure functions in azure

The next is to select the HTTP trigger on the New Function window.

create azure functions using azure portal

On the New Function Window, you can keep the default name, provide a new name, and then Choose the Authorization level as Function. Finally, click on the Create Function to create the function.

create azure function in azure

Now, you can see the Function created successfully.

how to create azure function app

Now you can see the function created successfully, click on the Code + Test link from the left navigation, Now you can able to see the inbuilt code in the right-side editor. You can modify the code as per your requirement and then click on the save button. It will save the changes.

create an azure function using azure portal

Test Azure Function In Portal

Now, you can test the function to see if it works as expected. Click on the Test/Run button to test the function.

Then, on the Input window, select the POST method; you can change the name parameter value in the Body and click the Run button.

Steps to create an azure function using azure portal

You can see that we got the output and the HTTP response code as expected.

Steps to create an azure function in azure portal

I just changed the name parameter value from Azure to Raj and clicked the run button.

Steps to create an azure function in azure

Now, you can see the expected output and response code below.

Steps to create an azure functions

Now what we will do is we will test this function App in the Postman app. So click on the Get function URL button from the top.

How To Create Azure Function Apps in Azure

On the Get function URL popup, click on the Copy button to copy the function URL

Create Azure Functions in Azure

The URL will be like below

Now open the Postman app and paste the URL, choose the POST operation, provide the JSON parameter value in the body, and click the Send button. Now, you can see the expected output with the proper response code.

create a function app in azure

Now, I have modified a little bit in the code in the function in the Azure Portal as below and clicked on the Save button to save the changes.

create a function app in azure Portal

Run the Postman app again to check if it is working as expected. Now you can see below we got the expected response based on our update in Azure Function.

How To Create Azure Function In The Azure Portal

You can also Create Azure Functions In Visual Studio.

Wrapping Up

In this Azure article, we discussed how to create a Function App in Azure Portal. Thanks for reading this article !!!