Azure Functions is a serverless compute service that enables you to run code on-demand without having to explicitly provision or manage infrastructure. Use Azure Functions to run a script or piece of code in response to a variety of events.
This article will show you how to create a new Azure Function that will expose an HTTP endpoint which will accept a couple of Query String parameters from the HTTP Request, and then will output a calculated value based on the input parameters.
Here we want to create a Function that is triggered by an HTTP endpoint.
Step 1
Login to your Microsoft Azure portal, click on Create new resource and select Function App from Compute category. Enter the Name, what Subscription you want it to belong to, create a new Resource Group, choose the hosting plan as Consumption Plan, the Location where we want to host the same and leave the Storage account as default (you can customize the name or select an existing according to your choice). Wait for a few minutes for the resource to be created.

Step 2
Step 3
Click on the Custom function link which you can find at the bottom of the Get started quickly interface.
Step 4
Select the HttpTriggerWithParameters C# Template from the Choose a template interface. This will setup a new Function that can be triggered over an HTTP endpoint and accept Query String parameters sent within the HTTP Request. It will also be setup to output to the HTTP Response. Make sure you select the C# Version.
Step 5
Leave the Language as C#, give a Name or go with default, leave the Authorization level function as default and click on default which will create the new function based on the template. Now we have just created a new function that is triggered by an HTTP endpoint.
Step 6
Here, the default template function will accept a single Query String parameter with the name of the HTTP Request. Then the function prefixes the passed value with Hello and returns the result in the HTTP Response.
Step 7
Click on the Run button above the code to open the Test Pane view to test the functionality of this function.
Step 8
In the Test pane to the right of the code view, enter a value in the value field underneath Query next to the name parameter and set GET for the HTTP Method and click run again with the configured setting and parameter (If it is showing status code error as unauthorized, go to manage blade of the function and click on renew for the function key)





Hadshana KamalanathanPosted Jul 17, 2018, 6:36 PM
Thank you for sharing.