Now, we will start to build our project. First we will create the API for storing data in Cosmos DB. Once the API is created, we will then move on to design our user form using HTML and CSS.
For creating APIs, we need to create
HttpTrigger in Azure Function.
Let's start with the creation of the API using Azure Function:
- First, login to the Azure portal. Navigate to the Function App, which we have created in the previous chapter.
- Click on the plus sign, select the language as
HttpTriggerfunction, as shown in the following screenshot:
- Now, provide a name to the function and click on
- Once the function is created, the default code will be opened:
- Now, we need to create the API, which takes an input from the request and stores the output in the database. So, click on
Integrateto add output binding:
- Now, click on
Outputsto add output binding as Cosmos DB:
Azure Cosmos DB, and then click on the
- To add output binding as Cosmos...