How To Add Cosmos DB Database for Your NodeJS Azure Functions

An Example Project with MongoDB Flavour for Cosmos DB

Bhargav Bachina
Bachina Labs

--

Writing Serverless code is very common nowadays. Azure offers Azure Functions that let you pay only the time when the code is running. You can write Azure functions in different languages such as Java, Python, NodeJS, etc.

In this post, we will see how can configure MongoDB API for CosmosDB with your NodeJS Azure Functions.

  • Prerequisites
  • Example Project
  • Creating a Cosmos DB with Mongo API
  • Configuring MongoDB in your Azure Functions
  • Writing a DB Layer
  • Running Locally
  • Deploy To Azure
  • Running on Azure
  • Best Practices
  • Summary
  • Conclusion

Prerequisites

Below are the tools and technology that you need to be familiar with to write NodeJS Azure functions. Make sure you understand the below post as well.

How To Write NodeJS REST API With Azure Functions — Typescript Version

--

--