Hello Everyone this is my Seventh Article in Azure Series. If you missed to read my Azure App services article please click here.

What is Azure Function?

Azure Functions allows you to run small pieces of code (called “functions”) without worrying about application infrastructure. With Azure Functions, the cloud infrastructure provides all the up-to-date servers you need to keep your application running at scale.

A function is “triggered” by a specific type of event. Supported triggers include responding to changes in data, responding to messages, running on a schedule, or as the result of an HTTP request.

Features

For more : click here

Create a function in Azure using Visual Studio Code

In this article, you use Visual Studio Code to create a Java function that responds to HTTP requests. After testing the code locally, you deploy it to the serverless environment of Azure Functions.

Configure your environment

Before you get started, make sure you have the following requirements in place:

Create your local project

Step 1 : Add Azure Function Extension in visual studio code

Step 2: Choose the Azure icon in the Activity bar, then in the Azure: Functions area, select the Create new project… icon.

Run the function locally

Visual Studio Code integrates with Azure Functions Core Tools to let you run this project on your local development computer before you publish to Azure.

3. With Core Tools running, navigate to the following URL to execute a GET request, which includes ?name=Functions query string.

http://localhost:7071/api/HttpExample?name=Functions

4. Information about the request is shown in Terminal panel.

5. Press Ctrl + C to stop Core Tools and disconnect the debugger.

Sign in to Azure

Publish the project to Azure

In this section, you create a function app and related resources in your Azure subscription and then deploy your code.

Run the function in Azure

Back in the Azure: Functions area in the side bar, expand the new function app under your subscription. Expand Functions, right-click (Windows) or Ctrl + click (macOS) on HttpExample, and then choose Copy function URL.

Paste this URL for the HTTP request into your browser’s address bar, add the name query string as ?name=Functions to the end of this URL, and then execute the request. The URL that calls your HTTP-triggered function should be in the following format:

http://<functionappname>.azurewebsites.net/api/httpexample?name=Functions

Reference : click here

This is the end of this article. See you in the next article..!

Thank you…!

Next Article: Azure Database for MySQL server