Creating a new Function App
In this post we will look at creating a new Azure Function App and explore a provided example.
Let’s start by creating a new Function App and walk through the setup process. (This post assumes you already have an Azure account.)
1. Add a Function App by clicking on the + icon and searching for Function App
2. fill in the details of your new function. Keep in mind, the app name is unique across the namespace, which means, you will not be able to use the same name as I used here in this tutorial.
As of the writing of this post, Dynamic pricing was not available on Microsoft Azure Function Pricing. make sure you check the pricing page to get the latest update
3. Once the function app is created and deployed successfully, it will open the function home view
Now you are ready to experiment with Azure Function App. Go ahead and explore the samples provided.
Here, we are going to examine a sample under Webhook + API scenario using C# as our language.
Select Webhook + API scenario, select C# as the language, then click “Create this function“
once the function is created, Azure Portal will open this windows:
Running the function
We can run the function online by scrolling down the page to the Run section and test our newly created function and click Run.
This gives us a quick way to test our function to make sure it’s behaving as expected
Now let us try to invoke this function from Fiddler:
1. copy the Function Url from the sample function.
2. open fiddler and go to composer, choose POST as the method, paste the Function Url copied earlier
Now execute the request and you should get a result of code 200, bellow showing both raw request and response.
In this tutorial we have seen how to create an Azure Function App, create a sample function and run the function both online and from a desktop application.
What is really significant here, there was no server to provision, no code to compile and no configurations to enable API endpoint.
Azure Function can play a significant role in a (Micro)service solution focusing on single responsibility and agility in building a robust architecture.
In the up coming posts, we will take this further in building a real life solution using Azure Function.