MEAN.js with Cosmos DB on Azure

(a YouTube series by John Papa)

Cosmos DB is of significant interest to myself for projects I have been engaged in for the past couple of years which use MongoDB and MEAN in several ways. Scaling for us has always been a bit of a pain with MongoDB, and Cosmos DB on Azure looks to be relieving a lot of the headaches we have had.

MEAN stands for MongoDB, Express, Angular and Node.

I am not the author of these – this is a reference list to a YouTube series by John Papa introducing MEAN with Cosmos DB on Azure. I would normally just link directly to the creators blog or post for a series such as this, but it seems to be offline just now so I thought I would share a full list of current videos here – hopefully the original link will work again soon – which is

MEAN.js with Cosmos DB – Part 1: Introduction

John builds a lot of apps with MongoDB, Express, Angular and Node (MEAN). MongoDB just works so well with these, but recently he has been using Cosmos DB on Azure in its place because it’s easy to use, scale, is super fast, and he does not have to change how he codes.

MEAN.js with Cosmos DB – Part 2: Creating the Node.js and Express App

Creating a Node.js and Express App along with the Angular CLI. Then create a web API endpoint and try it out.

MEAN.js with Cosmos DB – Part 3: Angular and Express APIs

The A in MEAN stands for Angular. This video shows how to build an Angular UI that talks to the Express API, with GET, POST, PUT, and DELETE.

MEAN.js with Cosmos DB – Part 4: Creating and Deploying Cosmos DB

Using the Azure CLI, to create the Cosmos DB account to represent a MongoDB model database and deploy it to Azure. Then view what we created in the Azure portal.

MEAN.js with Cosmos DB – Part 5: Querying Cosmos DB

How to connect to the MongoDB database with Azure Cosmos DB, using Mongoose, and query it for data.

You can subscribe to John’s YouTube series at or follow him on twitter @John_Papa

Azure SQL Data Warehouse: Troubleshoot with the Resource Health check

Azure DW Resource HealthAzure DW Resource Health2 New update for Azure SQL Data Warehouse…

Reduce troubleshooting time with the upgraded Resource Health check for SQL Data Warehouse.

This upgrade considers the health status of all components of the SQL Data Warehouse architecture, which includes each SQL database distribution and the SQL Data Warehouse engine on each compute node. Login and heartbeat signals of each component are emitted at least once every 2 minutes, providing you a low-latency, holistic view of the health status of your data warehouse. If your instance is Unavailable, we will provide the reason along with recommended actions that you should perform.

The Resource Health check can detect unavailability reasons, such as when your instance is pausing, scaling, or upgrading. This feature also detects when there are any connection issues, whether they are user connections or inner SQL database connections.

You check the health of SQL Data Warehouse by signing in to the Azure portal and clicking the Resource Health blade.

Source: –

RESTful interactions with Azure Cosmos DB resources using the DocumentDB API, CRUD operations, API for MongoDB and additional quick starts

Azure Cosmos DB is a globally distributed system that supports the document, graph, and key-value data models which Microsoft have classified as a multi-model database service for mission-critical systems.

It also supports both the API for MongoDB and the DocumentDB API for creating, querying, and managing resources.

If you would like to understand how to answer any of the following questions: –

  • How do the standard HTTP methods work with Azure Cosmos DB resources?
  • How do I create a new resource using POST?
  • How do I register a stored procedure using POST?
  • How does Azure Cosmos DB support concurrency control?
  • What are the connectivity options for HTTPS and TCP?
Cosmos DB - interactions-with-resources2

Interaction model using the standard HTTP methods

Then take a look at Azure Cosmos DB REST API for full details first published on 18th July 2017 which covers these topics.

If interested in performing CRUD operations using REST, see Common tasks using the Azure Cosmos DB REST API.

If interested in performing CRUD operations using C# and REST, see the REST from .NET Sample on GitHub which can help you out.

If interested in more details of the MongoDB API, then see Introduction to Azure Cosmos DB: API for MongoDB which covers the benefits of using Azure Cosmos DB for MongoDB applications.


MongoDB wire protocol

… and finally if looking for help getting started then the following MongoDB quick starts will help you out: –

and also: –


Azure Cosmos DB with Scott Hanselman

Published on Jun 27, 2017

Kirill Gavrylyuk stops by Azure Friday to talk Cosmos DB with Scott Hanselman.

Watch this quick overview of the industry’s first globally distributed multi-model database service followed by a demo of moving an existing MongoDB app to Cosmos DB with a single config change.

For more information, see:

Querying Azure Cosmos DB resources using the REST API

Cosmos DB REST API Query
Azure Cosmos DB is a globally distributed multi-model database with support for multiple APIs. This is a link to an article which describes how to use REST to query resources using the Azure Cosmos DB API –

All Cosmos DB resources (with the exception of account resources) can be queried using Azure Cosmos DB SQL language. See Query with Azure Cosmos DB SQL for additional details on syntax –

For a full sample using .NET visit

Build a Node.js or Java web app for Azure Cosmos DB

Simple Java Web App for Cosmos DB
These two articles for Node.js and Java are tutorials that explores how to use Microsoft Azure Cosmos DB to store and access data from a Node.js Express or Java web application hosted on Azure Websites.

Develop locally with the Azure Cosmos DB Emulator

CosmosDB Emulator
The Azure Cosmos DB Emulator provides a local development environment that emulates the Azure Cosmos DB service. Using this you can develop and test your application locally, without the need for an Azure subscription or incurring any costs. Once development is complete and you are ready, you can switch across to using an Azure Cosmos DB account in the cloud.

This is a handy article which covers the following tasks:

  • Installing the Emulator
  • Running the Emulator on Docker for Windows
  • Authenticating requests
  • Using the Data Explorer in the Emulator
  • Exporting SSL certificates
  • Calling the Emulator from the command line
  • Collecting trace files

There are some limitations to the Emulator, when compared to the highly scalable cloud version, below is an outline of some of the differences…

Azure Cosmos DB Emulator Azure Cosmos DB Cloud Service
Supports only a single fixed account and a well-known master key. Key regeneration is not possible. Supports multiple accounts and different master keys. You can regenerate keys any time from Azure Portal
Non scalable. Highly scalable
Does not support larger data sets. Support for large data sets
Does not simulate consistency levels. Different Consistency levels available
Does not simulate multi-region replication. Configurable as part of the platform, as needed basis
Does not support quota override feature. Supports document size limit increases, increased partitioned collection storage etc.
Will not support most recent changes to Cosmos DB platform. Most recent platform updates are available