Skip to content

fix: removed the container creation from code, added all the env variable in bicep for local setup#190

Merged
Roopan-Microsoft merged 9 commits into
mainfrom
dev
Aug 11, 2025
Merged

fix: removed the container creation from code, added all the env variable in bicep for local setup#190
Roopan-Microsoft merged 9 commits into
mainfrom
dev

Conversation

@Dhruvkumar-Microsoft

Copy link
Copy Markdown
Contributor

Purpose

This pull request updates how Cosmos DB containers are accessed and initialized in the backend, shifting from creating containers if they don't exist to simply accessing existing ones. It also updates related tests and expands the outputs in the infrastructure Bicep file to expose more resource information.

Backend: Cosmos DB Container Access

  • Changed the Cosmos DB initialization logic in cosmosdb.py to use get_container_client for accessing containers, instead of attempting to create them with create_container. This simplifies the code and avoids unnecessary creation attempts.
  • Removed the _get_or_create_container method and replaced it with _get_container, which only fetches existing containers.
  • Updated imports to remove unused PartitionKey and exceptions imports.

Tests: Cosmos DB Initialization

  • Updated the tests in cosmosdb_test.py to mock and assert calls to get_container_client instead of create_container, ensuring they align with the new container access logic. [1] [2] [3] [4] [5]

Infrastructure: Bicep Outputs

  • Added multiple new outputs to infra/main.bicep to expose resource endpoints, names, and connection strings for Cosmos DB, Azure Blob Storage, OpenAI, AI Agent, and Application Insights, making it easier to access these values from deployment outputs.

Does this introduce a breaking change?

  • Yes
  • No

Golden Path Validation

  • I have tested the primary workflows (the "golden path") to ensure they function correctly without errors.

Deployment Validation

  • I have validated the deployment process successfully and all services are running as expected with this change.

What to Check

Verify that the following are valid

  • ...

Other Information

@Roopan-Microsoft
Roopan-Microsoft merged commit 40ccff2 into main Aug 11, 2025
10 checks passed
Ritesh-Microsoft pushed a commit that referenced this pull request Oct 10, 2025
fix: removed the container creation from code, added all the env variable in bicep for local setup
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.5.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants