Exercise 1 – Creating a serverless solution using an Azure Function
This section will look at the steps to create a simple Hello World type of serverless solution example that will use a function based on an HTTP trigger. When we pass a value, code will be triggered to execute and return a response.
This could be the basis for a very simple inventory or assets, a lookup solution, or any solution that requires a message to be displayed when there is an HTTP request.
In the following subsections, the process of creating a solution has been segregated into tasks for ease of understanding.
Task – Accessing the Azure portal
- Log into the Azure portal: https://portal.azure.com.
Task – Creating a Function App
- In the search bar, type function app; click on Function App from the results list.
- From the Function App blade, click on the + Create button on the top toolbar.
- From the Basics tab, set the Project Details settings as required.
- Set the Instance Details settings as follows:
- Function App name: Enter a name; this must be globally unique.
- Publish: Leave this set to code.
- Runtime Stack: Set this to .NET.
- Version: Set this to 3.1.
- Region: Set this to the region that’s closest to you.
- Leave all other tabs with their default settings.
- Click Review + create.
- On the Review + create tab, review your settings; you may go back to the previous tabs and make edits if required. Once you have confirmed your settings, click Create.
- When the deployment is complete, you will receive a notification stating that the deployment succeeded. Now, click Go to resource from the deployment blade or navigate to the Azure Function App instance.
Task – Creating an HTTP triggered function
- On the Function App blade, click the created Function App.
- On the left menu, in the Functions section, click Functions.
- Click + Add from the top toolbar.
- From the Add function pop-up window, click HTTP trigger from the

Figure 5.25 – Add function
14. From the Function blade, click Code + Test from the left menu:

Figure 5.26 – Function blade
15. From the Code + Test blade, you will see some auto-generated sample code; this will return a hello (name) message:

Figure 5.27 – Function app code
Task – Testing the function trigger
- Click Get function URL from the top toolbar of the code editor and copy the function URL; the key value should be set to the default.
- Open a new browser tab and paste in the copied function URL. The function will run when the page is requested and execute the code; this will prompt/require a name to be returned in the string or body response:

Figure 5.28 – HTTP URL trigger
- Append &name=yourname to the end of the URL.
- When you hit Enter, your function will run and return the name you entered:

Figure 5.29 – HTTP URL response
In this exercise, we looked at creating a Function App to display a hello (name) message when there is an HTTP request; that is, a URL is called. In the following exercise, we will look at creating a serverless solution using an Azure Logic App.