Skip to content

DevBrain 2.0: ASP.NET Core host on Azure Container Apps (retires Azure Functions) - #26

Merged
dsghi merged 5 commits into
mainfrom
codex/devbrain-v2-container-apps
Sep 29, 2026
Merged

dsghi merged 5 commits into
mainfrom
codex/devbrain-v2-container-apps

Conversation

@dsghi

@dsghi dsghi commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

DevBrain 2.0 replaces the Azure Functions host with a standalone ASP.NET Core MCP host on Azure Container Apps. The endpoint moves from /runtime/webhooks/mcp on the Function App to /mcp on the Container App. Existing Cosmos documents carry over unchanged.

  • Add DevBrain.Server, a .NET 10 ASP.NET Core MCP host on ModelContextProtocol.AspNetCore 2.2.0 and the 2026-07-28 MCP specification revision, with a stateless Streamable HTTP transport.
  • Extract the shared Cosmos and OAuth/DCR behavior into DevBrain.Core.
  • Add Azure Container Apps and ACR infrastructure, managed-identity access, health probes, rate limits, DevBrain.User app-role authorization, and a reprovision-safe azd workflow.
  • Retire the Azure Functions host. Remove the DevBrain.Functions project, the Function App and Flex plan, their role assignments and blob containers, the azd api service, and the Functions-only packages, including Microsoft.ApplicationInsights.WorkerService.
  • Harden OAuth diagnostics so caller-controlled values can't forge log entries or disclose OAuth secrets.
  • Refresh dependencies, migrate the tests to xUnit v3 on Microsoft.Testing.Platform, and make Directory.Build.props the single source of the release version.
  • Rewrite the README as a new-tenant runbook: Entra app with the DevBrain.User role, user assignment, provision, redirect URI, deploy, verify, first-run seeding, upgrading from 1.x, and operating notes.

Why

The Azure Functions MCP extension lags the current SDK and protocol behavior, and it doesn't let DevBrain own the MCP authentication challenge. That's why VS Code and GitHub Copilot never started OAuth. The direct ASP.NET Core host provides current protocol support, standards-compliant 401 challenges, and more hosting flexibility.

Deployment notes

  • Reuses the existing Cosmos documents and oauth_state containers; no data migration.
  • Keeps the dataprotection-keys-v2 key ring and the v2: OAuth key prefix, so live sessions on the current Container Apps deployment survive this change.
  • Defaults to zero minimum replicas and doesn't need Redis, Front Door, or a custom domain.
  • Retries the first managed-identity Cosmos role assignment during Entra propagation.
  • Preserves the deployed private image during later infrastructure-only provisions.
  • New OAUTH_REDIRECT_URI output gives the exact /callback URL to register on the Entra app.
  • Existing 1.x environments: azd provision is incremental, so it won't delete the old Function App, its plan, or the deploymentpackage and dataprotection-keys containers. Delete them manually once no client uses the old endpoint (README → "Upgrading from 1.x").

Tests

  • Renamed DevBrain.Functions.Tests to DevBrain.Core.Tests; both test projects now run on xunit.v3 4.0.1 through Microsoft.Testing.Platform (global.json).
  • Moved the RFC 6749/7591/8414/9728 wire-format guards onto the server's OAuth response types.
  • Removed the Functions-only McpToolContextAccessor tests and the Functions-vs-server contract parity test.
  • Added adversarial regression coverage for authorization, callback, registration, and token requests containing CR/LF injection payloads.

CodeQL disposition

Validation

  • dotnet test --solution devbrain.slnx: 157 tests pass across DevBrain.Core.Tests and DevBrain.Server.Tests.
  • dotnet build has 0 warnings; az bicep build succeeds; the post-provision hook parses cleanly; the container image builds from src/DevBrain.Server/Dockerfile.
  • dotnet list package --outdated / --vulnerable / --deprecated reports every direct reference current and nothing vulnerable or deprecated.
  • The Container Apps host is live in production. Managed-identity RBAC is verified, and the health endpoint stays healthy after reprovisioning.
  • The unified ChatGPT/Codex Windows app completed OAuth with DevBrain.User, discovered all 12 tools, and read existing shared Cosmos documents.
  • VS Code / GitHub Copilot completes OAuth and works end to end, which was blocked on the Functions host.
  • Cursor is expected to work (it supports current MCP OAuth) but hasn't been validated.

🤖 Generated with Claude Code

dsghi and others added 3 commits August 9, 2026 22:32
DevBrain now runs only as the ASP.NET Core host on Azure Container Apps.

- Remove the DevBrain.Functions project, its Function App, Flex plan,
  managed-identity role assignments, Functions-only blob containers,
  the azd api service, and the post-provision warm-up wait. This drops
  Microsoft.ApplicationInsights.WorkerService and the Functions worker
  packages.
- Rename DevBrain.Functions.Tests to DevBrain.Core.Tests, move the RFC
  wire-format guards onto the server's OAuth response types, and drop the
  Functions-only and Functions-vs-server parity tests.
- Migrate both test projects to xunit.v3 on Microsoft.Testing.Platform.
- Refresh dependencies (MCP SDK 2.2.0, Cosmos 3.63.1, IdentityModel
  8.23.0, DataProtection 10.0.12) and CI actions.
- Make Directory.Build.props the single source of the release version;
  serverInfo reads it from the assembly.
- Add an OAUTH_REDIRECT_URI output and rewrite the README as a
  new-tenant runbook with DevBrain.User role setup, a 1.x upgrade path,
  and operating notes. Fold everything into the 2.0.0 changelog entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dsghi dsghi changed the title Add DevBrain 2.0 ASP.NET Core host on Azure Container Apps DevBrain 2.0: ASP.NET Core host on Azure Container Apps (retires Azure Functions) Sep 29, 2026
@dsghi
dsghi marked this pull request as ready for review September 29, 2026 20:02
dsghi and others added 2 commits September 29, 2026 10:04
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dsghi
dsghi merged commit 5d5c1ac into main Sep 29, 2026
4 checks passed
@dsghi
dsghi deleted the codex/devbrain-v2-container-apps branch September 29, 2026 20:07
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.

1 participant