Node.js is a popular platform for building JavaScript applications that run outside the confines of a web browser. Visual Studio Code provides an environment you can use to develop and document applications written in a variety of languages. Many extensions are available to support integration with a range of frameworks and services, including Azure Databases. You can use the Azure Databases extension to create and manage Cosmos DB databases and documents. You can connect to a Cosmos DB database from a Node.js application using the @azure/cosmos JavaScript module.

Imagine you work as a software developer that builds applications for schools. You've been asked to develop an application that keeps track of students' grades for the various courses they've taken. You decide to use Cosmos DB to store the information about course grades. The application must be portable, so you decide to use JavaScript running in Node.js. Also, you're going to use Visual Studio Code as the development environment.

In this module, you'll learn how to build databases with Cosmos DB. You'll use Visual Studio Code as a tool for managing Cosmos DB, and as an environment for building the course grades application. Finally, you'll learn how to insert, update, delete, and query documents in a Cosmos DB container.

By the end of this module, you'll know how to use Node.js with Visual Studio Code to create and run Cosmos DB applications.

Learning objectives

In this module, you'll:

  • Create a Cosmos DB instance for a Node.js app
  • Build a new Node.js app in Visual Studio Code
  • Add JavaScript code to work with Cosmos DB


  • Visual Studio Code with Azure extensions installed
  • Node.js installed