Skip to content
This repository has been archived by the owner on Feb 15, 2024. It is now read-only.

Enhance local development experience with Azure Cosmos DB Linux Emulator and VS Code devcontainers

License

Notifications You must be signed in to change notification settings

Azure-Samples/cosmosdb-java-devcontainers-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Azure Cosmos DB local dev experience with VS Code devcontainers

This sample demonstrates how to enhance your local development experience with Azure Cosmos DB Linux Emulator and VS Code devcontainers.

Before you begin

Make sure to follow the instructions outlined in the Getting started section in "Developing inside a Container". This includes setting up Visual Studio Code, OS specific requirements, Docker (and Docker compose), and VS Code Remote Development extension pack

To run the example:

Start by cloning this repository:

git clone https://github.com/Azure-Samples/cosmosdb-java-devcontainers-demo

Open Visual Studio Code, press F1 and select the Remote-Containers: Open Folder in Container... command. Select the project folder you just cloned and wait for the container to start.

The dev container will be built the first time you open it - opening the folder after the first successful build will be much quicker.

To try out the CRUD operations quick start, run the following command in the VS Code terminal:

mvn clean package && mvn exec:java -Dexec.mainClass="com.azure.cosmos.examples.crudquickstart.sync.SampleCRUDQuickstart" -DACCOUNT_HOST=https://localhost:8081/ -DACCOUNT_KEY=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==

localhost:8081 is the endpoint for Azure Cosmos DB Emulator

Once the Maven dependencies are downloaded, the program will create database, container and execute CRUD operations. Browse to https://localhost:8081/_explorer/index.html to check the Azure Cosmos DB Emulator portal.

This is a derived version of the sample code repo for Azure Cosmos DB Java SDK for SQL API to show local development experience with VS Code devcontainers. Couple of changes have been made for this sample:

About

Enhance local development experience with Azure Cosmos DB Linux Emulator and VS Code devcontainers

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Languages