Description
Azure Cosmos DB is a fully managed, horizontally scalable, NoSQL and relational database.Examples
Dependency:
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>azure</artifactId>
<version>1.20.0</version>
<scope>test</scope>
</dependency>
Usage:
var cosmos = new CosmosDBEmulatorContainer(
DockerImageName.parse("mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:latest")
);
cosmos.start();
Dependency:
dotnet add package Testcontainers.CosmosDb --version 3.9.0
Usage:
var cosmosDbContainer = new CosmosDbBuilder()
.WithImage("mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:latest")
.Build();
await cosmosDbContainer.StartAsync();
Dependency:
pip install testcontainers[cosmosdb]
Usage:
with CosmosDBNoSQLEndpointContainer() as emulator:
client = CosmosClient(url=emulator.url, credential=emulator.key, connection_verify=False)
db = client.create_database_if_not_exists("test")