Skip to content
Star
478
Star
478

NoSQL Writer

This guide shows you how to work with Azure Cosmos DB locally using Docker and Python. This lab demonstrates how to connect a Python application to the Azure Cosmos DB Emulator.

  1. Setup Environment:

    Open VS Code in the project folder and execute this command in the Command Palette:

    Terminal window
    > Dev Containers: Reopen in Container
  2. Run the Example:

    Terminal window
    python main.py

Open the Cosmos DB Explorer in your browser:

Terminal window
http://localhost:1234/
Terminal window
docker compose down -v
IssueSolution
Connection RefusedEnsure the emulator is running: docker ps
PostgreSQL=FAIL in logsReset the emulator state: docker compose down -v
Evaluation period expiredRemove the old image (docker rmi mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator), pull latest, and restart.