How To Create Azure Function App Using Azure Portal

Introduction

In this article, we will understand azure function app. How to create azure function app using azure portal. Azure Functions lets you run your code in a serverless environment without creating a virtual machine (VM) or publish a web application. 

What is the use of function app in Azure?

A function app lets you group functions as a logical unit for easier management, deployment, scaling, and sharing of resources.

Language support by azure function app

  1. C# class library
  2. C# script
  3. JavaScript
  4. Python
  5. Java
  6. PowerShell
  7. TypeScript
  8. Go/Rust/other

Type of azure function app trigger
 

Trigger Template Description
HTTP trigger A function that will be run whenever it receives an HTTP request, responding based on data in the body or query string
Timer trigger A function that will be run on a specified schedule
Azure Queue Storage trigger A function that will be run whenever a message is added to a specified Azure Storage queue
Azure Service Bus Queue trigger A function that will be run whenever a message is added to a specified Service Bus queue
Azure Service Bus Topic trigger A function that will be run whenever a message is added to the specified Service Bus topic
Azure Blob Storage trigger A function that will be run whenever a blob is added to a specified container
Azure Event Hub trigger A function that will be run whenever an event hub receives a new event
Azure Cosmos DB trigger A function that will be run whenever documents change in a document collection
IoT Hub (Event Hub) A function that will be run whenever an IoT Hub receives a new event from IoT Hub (Event Hub)
SendGrid A function that sends a confirmation e-mail when a new item is added to a particular queue
Azure Event Grid trigger A function that will be run whenever an event grid receives a new event
Durable Functions Entity HTTP starter A function that will trigger whenever it receives an HTTP request to execute an orchestrator function.
Durable Functions HTTP starter A function that will trigger whenever it receives an HTTP request to execute an orchestrator function.
Durable Functions activity A function that will be run whenever an Activity is called by an orchestrator function.
Durable Functions entity (class) A C# entity that stores state and represented by a class.
Durable Functions entity (function) A C# entity that stores state and represented by a function.
Durable Functions orchestrator An orchestrator function that invokes activity functions in a sequence.
Kafka output A function that will send messages to a specified Kafka topic
Kafka trigger A function that will be run whenever a message is added to a specified Kafka topic.
RabbitMQ trigger A function that will be run whenever a message is added to a specified RabbitMQ queue
SignalR negotiate HTTP trigger An HTTP triggered function that SignalR clients will call to begin connection negotiation

Step 1

If you don't have an Azure subscription, create an Azure free account before you begin.

Step 2

Sign in to the Azure portal with your Azure account.

Step 3

From the Azure portal menu, or from the Home page, select Create a resource.

Step 4

On Azure portal in the Search box, enter Function App. From the results list, choose Function App.

Step 5

On the function app section, choose Create Function App.

Step 6

On the Create Function App section provide the following information:

  1. Subscription: Choose a subscription
  2. Resource Group, Choose Create new and enter a resource group name or you can choose existing resource group created.
  3. Function App Name: A unique name is required.
  4. Publish: Choose code
  5. Runtime stack: .NET
  6. Version: 6
  7. Region: Choose region
  8. Operation System: Choose Window
  9. Plan Type: consumption serverless

Select Next: Hosting. On the Hosting page, enter the following settings:

Storage account: Select existing storage or create new storage.

Select Next: Monitoring. On the Monitoring page, enter the following settings:

Application Insights: Enable application insight to choose No or Yes.

Select Review + create to review the app configuration selections.

On the Review + create page, review your settings, and then select Create to provision and deploy the function app.

Select the Notifications icon in the upper-right corner of the portal and watch for the Deployment succeeded message.

Select Go to resource to view your new function app. You can also select Pin to dashboard. Pinning makes it easier to return to this function app resource from your dashboard.

Next, create a function in the new function app.

How to Create an HTTP trigger function

  1. From the left menu of the Function App window, select Functions, and then select Create from the top menu.
  2. From the Create Function window, leave the Development environment property as Develop in portal, and then select the HTTP trigger template.
  3. Under Template details use HTTP trigger for New Function, select Anonymous from the Authorization level drop-down list, and then select Create.

Azure creates the HTTP trigger function. Now, you can run the new function by sending an HTTP request.

How to Test the function

  1. In your new HTTP trigger function, select Code + Test from the left menu, and then select Get function URL from the top menu.

In the Get function URL dialog, select default from the drop-down list, and then select the Copy to clipboard icon.

Now Paste the function URL into your browser's address bar. Add the query string value ?name=<your_name> to the end of this URL and press Enter to run the request. The browser must display a response message that echoes back your query string value.

https://myfuctionappdemo.azurewebsites.net/api/HttpTrigger1?code=RhvNQP92RlwE25Ni6am4yYXGxTUodV6qsmPDwR1Xuu-TAzFuuXtZ1w==&name=farhan

Conclusion

Congratulations you have created your first azure function app using azure portal. Azure functions as a serverless, compute-on-demand, lightweight, and independent app. We can create an entire web application and much other automation with different triggers and output bindings.


Similar Articles