How to create a Function App in Azure Portal

In this Azure article, we will discuss, the easiest approach to create a Function App in Azure using Azure Portal.

How to create a Function App in Azure Portal

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 accounnow.

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

Step-1: Login to Azure Portal (https://portal.azure.com/)

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

How To Write Azure Functions

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

  • SubscriptionChoose your Correct Subscription.
  • Resource GroupChoose 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 it will 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 on the + Add button to create the Functions.

create azure functions in azure portal

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 as it is or you can 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 if it is working 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 then click on the Run button.

Steps to create an azure function using azure portal

Now you can see, that we got the output and the HTTP response code as expected.

Steps to create an azure function in azure portal

Now I have just changed the name parameter value from Azure to Raj and then clicked on 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

https://mynewdemofunctionapp.azurewebsites.net/api/HttpTrigger1?code=Sa3jSz9JrrapsN27yscWZm8wHsUO/GIMKg4V9aIhIm4CmXBiYFBgDw==

Now open the Postman app and paste the URL choose the POST operation provide the JSON parameter value in the body and then click on the Send button. Now you can able to 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

Now, to check if it is working as expected, Run the Postman app again. 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 !!!