ComosDB: Offline Emulator

Matt Thankachan
FAUN — Developer Community 🐾
3 min readJun 13, 2020

--

Azure Development using CosmosDB offline Emulator

CosmosDB Emulator Data Explorer

Use Case: Your organization decides to move away from on-premise databases and decided to put their money on cloud-based data stores. Azure offers a No SQL database via Azure CosmosDB. Having and always running CosmosDB (even though with smaller RU) for Development purposes costs money. Hence Offline Emulator of CosmosDB helps in overcoming the cost challenges during development

Problem State: Your companies IT estate is unfortunately on Windows 7/8. Unfortunately, Microsoft states that for the emulator to work the software requirements would be Windows Server 2012 R2, Windows Server 2016, or Windows 10 with a 64-bit operating system.

Options

  1. Migrate Developer Machines to Windows 10
  2. Create a Windows VM via the Virtual Box or VM Player
  3. Provision Windows 10 VMs
  4. Install Offline Emulator on an existing Windows 2012/Windows 2016 server

I have selected the option # 4, which is much easier and can leverage the existing IT infrastructure

Download Location: CosmosDB emulator can be downloaded from here

Once downloaded install the emulator with admin credentials

Installation Dialog

In Windows search bar type CosmosDB and select Azure Cosmos DB Emulator as shown below

This is will start the cosmos emulator in the background. You can open the Emulator UI from the taskbar by clicking on the Open Data Explorer menu

Type https://localhost:8081/_explorer/index.html in the browser to access the CosmosDB

Select the Explorer icon on the left sidebar to Create the Database and containers

The below screens shows how I have used to insert around 1 million records into a PaidPriceData database with price data as container

The scale settings of emulator range from 400 -10,000 RU

The below image shows how I have used the connection string for local development.

More details Command-Line reference can be found invoking the command CosmosDB.Emulator.exe /help

Subscribe to FAUN topics and get your weekly curated email of the must-read tech stories, news, and tutorials 🗞️

Follow us on Twitter 🐦 and Facebook 👥 and Instagram 📷 and join our Facebook and Linkedin Groups 💬

If this post was helpful, please click the clap 👏 button below a few times to show your support for the author! ⬇

--

--