In this tutorial I will demonstrate how to build a REST API application using Azure Functions v3. The application we will build together uses Entity Framework Core Migrations, Dependency Injection and .NET Core 3.1. We will use the light-weight VS Code editor so that you can go through this tutorial on Windows 10, Mac or Linux.
Install the appropriate Azure CLI for your operating system from https://docs.microsoft.com/en-us/cli/azure/install-azure-cli.
You need to install the Azure Functions extension for Visual Studio Code before proceeding with this tutorial. Once the extension is installed, you will find it among your extensions.
In your working directory, create the following folder structure:
dotnet new slndotnet new classlib -f netcoreapp3.1 -o DataLayerdotnet sln add DataLayer/DataLayer.csproj
cd Functionsfunc start
Copy the URL (http://localhost:7071/api/HttpWebAPI) and paste it in the address line of your browser. You will see a response like this:
The message in your browser suggests that you should pass a name query string. I appended the following to the URL: ?name=Superman. I got the following result:
dotnet sln add Functions/Functions.csprojdotnet add Functions/Functions.csproj reference DataLayer/DataLayer.csproj
DataLayer class library project
Azure Functions Project
CTRL Click with your mouse on http://localhost:7071/api/students. It should open up a browser window with the following data: