Skip to content

Support Cosmos DB emulator in spring-cloud-azure-docker-compose#48134

Closed
Copilot wants to merge 2 commits intomainfrom
copilot/add-cosmos-support-docker-compose
Closed

Support Cosmos DB emulator in spring-cloud-azure-docker-compose#48134
Copilot wants to merge 2 commits intomainfrom
copilot/add-cosmos-support-docker-compose

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 26, 2026

Cosmos DB was the only service supported in spring-cloud-azure-testcontainers but missing from spring-cloud-azure-docker-compose.

Changes

  • CosmosDockerComposeConnectionDetailsFactory — new factory matching images containing cosmosdb/linux/azure-cosmos-emulator; wires endpoint (https://<host>:8081/), the well-known emulator key, GATEWAY connection mode, and endpointDiscoveryEnabled=false. Database is intentionally null so users configure it via spring.cloud.azure.cosmos.database.

  • ConfigurationWithConnectionDetailsBean — only overrides database when ConnectionDetails.getDatabase() returns non-null, preserving user-configured values when connection details don't supply a database.

  • pom.xml — adds azure-cosmos as an optional compile dependency (required for ConnectionMode).

  • spring.factories — registers CosmosDockerComposeConnectionDetailsFactory.

  • Test + docker-compose YAMLCosmosDockerComposeConnectionDetailsFactoryTests verifies the factory produces correct connection details when the emulator is running.

Usage

# docker-compose.yaml
services:
  cosmos:
    image: mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:latest
    ports:
      - "8081"
    environment:
      AZURE_COSMOS_EMULATOR_PARTITION_COUNT: 3
      AZURE_COSMOS_EMULATOR_ENABLE_DATA_PERSISTENCE: false
# application.properties
spring.cloud.azure.cosmos.database=mydb

Spring Boot auto-detects the running Cosmos emulator service and populates AzureCosmosConnectionDetails automatically.

Original prompt

This section details on the original issue you should resolve

<issue_title>[FEATURE REQ] Support Cosmos in spring-cloud-azure-docker-compose</issue_title>
<issue_description>Is your feature request related to a problem? Please describe.

Current status

Service Supported in spring-cloud-azure-docker-compose Supported in spring-cloud-azure-testcontainers
Service Bus
Cosmos
EventHubs
StorageBlob
StorageQueue

Describe the solution you'd like
Support Cosmos in spring-cloud-azure-docker-compose

Additional context
Link to related comment: #41321 (comment)

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Description Added
  • Expected solution specified
    </issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: rujche <171773178+rujche@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for Cosmos in spring-cloud-azure-docker-compose Support Cosmos DB emulator in spring-cloud-azure-docker-compose Feb 26, 2026
@rujche
Copy link
Copy Markdown
Member

rujche commented Feb 27, 2026

Closing this PR. Current implementation can not solve this problem: unable to find valid certification path to requested target. I tried to use Copilot to fix this problem, but failed.

@rujche rujche closed this Feb 27, 2026
@rujche rujche deleted the copilot/add-cosmos-support-docker-compose branch February 27, 2026 03:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE REQ] Support Cosmos in spring-cloud-azure-docker-compose

2 participants