Skip to content

Add sovereign cloud support to next/core (GCCH, DoD, China)#413

Draft
corinagum wants to merge 5 commits intonext/corefrom
cg/sovereign-cloud-nextcore
Draft

Add sovereign cloud support to next/core (GCCH, DoD, China)#413
corinagum wants to merge 5 commits intonext/corefrom
cg/sovereign-cloud-nextcore

Conversation

@corinagum
Copy link
Copy Markdown
Contributor

Summary

  • Cherry-picks Libraries-layer sovereign cloud changes from Add sovereign cloud support (GCCH, DoD, China) #352
  • Adds core/ package support: BotConfig cloud resolution, MSAL Instance from CloudEnvironment.LoginEndpoint, cloud-aware default scope, cloud-aware UserTokenClient endpoint

core/ changes

File Change
core/src/.../Hosting/BotConfig.cs Cloud property, resolved from config key in all 3 formats (BF, Core, AzureAd)
core/src/.../Hosting/BotClientOptions.cs Cloud property, scope defaults from cloud
core/src/.../Hosting/AddBotApplicationExtensions.cs Cloud-aware MSAL Instance, resolves cloud from config, threads through all auth methods
core/src/.../UserTokenClient.cs Cloud-aware default token service endpoint

Test plan

  • dotnet build — 0 errors
  • dotnet test — 42 sovereign cloud tests pass (24 CloudEnv + 9 BotTokenClient + 9 TeamsValidationSettings)

Depends on

🤖 Generated with Claude Code

rajan-chari and others added 5 commits March 26, 2026 14:40
Introduce CloudEnvironment class that bundles all cloud-specific service
endpoints, with predefined instances for Public, USGov (GCCH), USGovDoD,
and China (21Vianet). Thread the cloud environment through ClientCredentials,
token clients, validation settings, and DI host builders so that all
previously hardcoded endpoints are now configurable per cloud.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Allow users to override specific CloudEnvironment endpoints (e.g.
LoginEndpoint, LoginTenant) via appsettings.json, enabling scenarios
like China single-tenant bots that require a tenant-specific login URL.

- Add CloudEnvironment.WithOverrides() for layering nullable overrides
- Add 8 endpoint override properties + ResolveCloud() helper to TeamsSettings
- Unify cloud resolution across Apply(), AddTeamsCore(), and AddTeamsTokenAuthentication()
- Add WithOverrides unit tests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ated files

- Keep static BotTokenClient.BotScope unchanged (avoids breaking change)
- Add ActiveBotScope instance property for per-cloud scope configuration
- Remove CLAUDE.md, Claude-KB.md, and .gitignore session file entries
  that were unrelated to sovereign cloud support

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- CloudEnvironmentTests: ClientCredentials cloud property defaults and assignment
- BotTokenClientTests: ActiveBotScope defaults, overrides, and usage in GetAsync
- TeamsValidationSettingsTests: sovereign cloud issuers, JWKS, login endpoints,
  tenant-specific URLs, and audience handling

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Thread CloudEnvironment through the core/ MSAL-based architecture:
- BotConfig: resolve Cloud from configuration (Cloud/CLOUD key) across
  all 3 config formats (BF, Core env vars, AzureAd section)
- BotClientOptions: Cloud property for scope and instance resolution
- AddBotApplicationExtensions: use cloud.LoginEndpoint for MSAL Instance
  (resolves 3 TODO comments), cloud-aware default scope
- UserTokenClient: cloud-aware default token service endpoint

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

2 participants