-
Notifications
You must be signed in to change notification settings - Fork 397
Bicep Cosmos DB Backend Parity & Documentation #363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
james-tn
wants to merge
54
commits into
int-agentic
Choose a base branch
from
james-dev
base: int-agentic
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Add intentionalClose flag to WebSocket manager to prevent auto-reconnect on intentional close - Fix Dockerfile to copy from Vite 'dist' instead of CRA 'build' directory - Update backend static file serving to handle both Vite (assets/) and CRA (static/) structures - Add catch-all exception handler for WebSocket disconnections in backend
…e workflow. I have also commented out all the tests for model endpoint, since that currently relies on key based access.
…ation to be insecure
- Use mcr.microsoft.com/k8se/quickstart:latest as placeholder image - Add lifecycle ignore_changes for container image (managed by update-containers) - Solves chicken-and-egg problem: Container Apps created before images exist in ACR - update-containers.yml sets real images after Docker builds complete
- Docker workflows should only run via workflow_call from orchestrate.yml - Prevents duplicate/orphan runs that occur before infrastructure exists - Manual dispatch still available for ad-hoc builds
- Add placeholder image support (mcr.microsoft.com/k8se/quickstart:latest) - Fix MCP allowInsecure when mcpInternalOnly is true - Add readiness probe to application container (/docs endpoint) - Add missing env vars: AZURE_AI_AGENT_MODEL_DEPLOYMENT_NAME, AZURE_OPENAI_EMBEDDING_DEPLOYMENT - Make AZURE_OPENAI_API_VERSION configurable via parameter - Align naming convention with environment suffix - Change image name from workshop-app to backend-app for consistency
…guide - Replace ASCII architecture diagrams with interactive Mermaid diagrams - Add comprehensive enterprise security sections (VNet, Private Endpoints, Managed Identity) - Document security profiles (Dev/Staging/Production) - Add CI/CD with GitHub Actions OIDC section linking to GITHUB_ACTIONS_SETUP.md - Update main README with enterprise deployment table linking to all guides - Add data flow and authentication flow sequence diagrams - Include troubleshooting guide with common issues
…guide - Replace ASCII architecture diagrams with interactive Mermaid diagrams - Add comprehensive enterprise security sections (VNet, Private Endpoints, Managed Identity) - Document security profiles (Dev/Staging/Production) - Add CI/CD with GitHub Actions OIDC section linking to GITHUB_ACTIONS_SETUP.md - Update main README with enterprise deployment table linking to all guides - Add data flow and authentication flow sequence diagrams - Include troubleshooting guide with common issues
- Create _backend_sqlite.py for local SQLite development - Create _backend_cosmos.py for production Cosmos DB - Update contoso_tools.py to select backend via USE_COSMOSDB env var - Remove mcp_service_cosmos.py (merged into mcp_service.py) - Remove contoso_tools_cosmos.py (merged into _backend_cosmos.py) - Remove unused sqlite3 import from mcp_service.py Usage: Set USE_COSMOSDB=true for Cosmos DB, false (default) for SQLite
…ars, add data seeding option
… state features Resolved merge conflicts: - _aca-mcp.tf: Combined MCP backend (USE_COSMOSDB, SEED_ON_STARTUP) with agent state env vars - cosmosdb.tf: Kept all containers from james-dev, added agent_state from int-agentic - variables.tf: Added seed_cosmos_data variable - main.bicep: Kept seedCosmosData parameter - mcp-service.bicep: Kept USE_COSMOSDB and SEED_ON_STARTUP env vars Accepted int-agentic's versions for: - deploy.ps1, providers.tf, dev.tfvars (cleaner structure with remote backend support) - reflection_agent.py, .env.sample, azure.yaml, SETUP.md, _backend_cosmos.py Kept james-dev's versions for: - infra/README.md (includes MCP backend documentation)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR: Bicep Cosmos DB Backend Parity & Documentation
Summary
Brings Bicep deployment to feature parity with Terraform for Cosmos DB backend support, including automatic data seeding and comprehensive documentation.
Changes
Bicep Infrastructure (bicep)
modules/cosmosdb.bicep
Added 8 missing Cosmos DB containers to match Terraform:
Invoices (partition key: /subscription_id)
Payments (partition key: /invoice_id)
SecurityLogs (partition key: /customer_id)
Orders (partition key: /customer_id)
SupportTickets (partition key: /customer_id)
DataUsage (partition key: /subscription_id)
ServiceIncidents (partition key: /subscription_id)
KnowledgeDocuments (partition key: /category, excludes /embedding/* from indexing)
modules/mcp-service.bicep
Added seedOnStartup parameter
Added environment variables: USE_COSMOSDB=true, SEED_ON_STARTUP
Fixed COSMOS_DB_NAME → COSMOS_DATABASE_NAME to match Terraform
main.bicep
Added seedCosmosData parameter (default: false)
deploy.ps1
Added parameters: -SeedCosmosData, -UseCosmosManagedIdentity, -McpInternalOnly
Fixed Container App naming pattern: {baseName}-{service}-{env} (was {baseName}-{env}-{service})
Changed container update to use az containerapp update --image instead of revision restart
MCP Service (mcp)
data_seeding.py
Changed default SEED_CUSTOMER_COUNT from 50 to 250 to match create_db.py
Documentation
README.md
Added "MCP Backend Options" section documenting:
SQLite vs Cosmos DB backend selection
All environment variables for Cosmos DB
Complete list of 12 containers with partition keys
Data seeding configuration and force re-seed instructions
README.md
Added "Backend Storage Options" section with SQLite and Cosmos DB setup instructions
Added environment variables table
Added note about managed identity authentication
Testing
✅ Deployed Bicep infrastructure with UseCosmosManagedIdentity=true, McpInternalOnly=true, SeedCosmosData=true
✅ Verified all 13 containers created in Cosmos DB
✅ Verified data seeding completed (250 customers, 9 scenarios, knowledge documents)
✅ Verified MCP service running with Cosmos DB backend