Get started with Azure Functions (Manual)

Azure Functions is a serverless solution that allows you to write less code, maintain less infrastructure, and save on costs. Instead of worrying about deploying and maintaining servers, the cloud infrastructure provides all the up-to-date resources needed to keep your applications running.

As you build your functions, you have the following options and resources available:

For multiple use cases Azure Functions will be useful. In this manual I will explain how to create an Azure function and some basic principles.

STEP 1: Go to the Azure Portal and go to Function App and Create a new function app

Give your Function a name, select a runtime, for this example I will be using PowerShell.

Choose or create a storage account.

I would highly recommend enabling Application insights, during testing it will help you gain insights when something goes wrong.

Now review and create the app 🙂

STEP 2: In the newly created Fuction app, go to Functions and create a new function.

Select the HTTP trigger, and make sure that the Authorization level is set to Function. For developing and testing purposes you can choose Anonymous.

From the newly created function we are going to need the function URL. As you can see, to post information to the function, we will need to send it with the parameter name.

Copy the URL, you will need it in step 3.

From the Function Keys, create a New function key.

Give the key a name, leave the Value blank to autogenerate a new key.

Copy the key value, you will need it in the next step.

Your Azure function is now ready. You can use any code in this function. Now let’s run a request from a powershell script:

  • The $name variable will be posted to your Azure function
  • The $functionkey is your access key
  • Change the URL to the one that you copied from your function URL.

$name = "2azure.nl"
$functionkey = "your function key"

$req = Invoke-WebRequest -Uri "https://2azure.demoapp.azurewebsites.net/api/HttpTrigger1?code=$functionkey&name=$name" -UseBasicParsing 

$req.Content

The result will look like this if you change $req.Content to $req in the last line

For more information about server plans visit the Microsoft website: Pricing – Functions | Microsoft Azure

Add a Comment

Your email address will not be published. Required fields are marked *