Building the project
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
JavaScript
, and click on theHttpTrigger
function, as shown in the following screenshot:
- Now, provide a name to the function and click on
Create
:
- 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
Integrate
to add output binding:
- Now, click on
Outputs
to add output binding as Cosmos DB:
- Select
Azure Cosmos DB
, and then click on theSelect
button:
- To add output binding as Cosmos...